[prev in list] [next in list] [prev in thread] [next in thread] 

List:       privoxy-commits
Subject:    [privoxy-commits] current cgisimple.c,1.55,1.56
From:       noreply () sourceforge ! net
Date:       2007-05-21 10:50:38
Message-ID: E1Hq5TK-00007j-Vq () mail ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/ijbswa/current
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv28322

Modified Files:
	cgisimple.c 
Log Message:
- Use strlcpy() instead of strcpy().
- Stop treating actions files special. Expect a complete file name
  (with or without path) like it's done for the rest of the files.
  Closes FR#588084.
- Don't rerun sed() in cgi_show_request().


Index: cgisimple.c
===================================================================
RCS file: /cvsroot/ijbswa/current/cgisimple.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- cgisimple.c	13 Apr 2007 13:36:46 -0000	1.55
+++ cgisimple.c	21 May 2007 10:50:35 -0000	1.56
@@ -36,6 +36,13 @@
  *
  * Revisions   :
  *    $Log$
+ *    Revision 1.56  2007/05/21 10:50:35  fabiankeil
+ *    - Use strlcpy() instead of strcpy().
+ *    - Stop treating actions files special. Expect a complete file name
+ *      (with or without path) like it's done for the rest of the files.
+ *      Closes FR#588084.
+ *    - Don't rerun sed() in cgi_show_request().
+ *
  *    Revision 1.55  2007/04/13 13:36:46  fabiankeil
  *    Reference action files in CGI URLs by id instead
  *    of using the first part of the file name.
@@ -549,8 +556,7 @@
       return JB_ERR_MEMORY;
    }
 
-   if (map(exports, "processed-request", 1, html_encode_and_free_original(
-      sed(client_patterns, add_client_headers, csp)), 0))
+   if (map(exports, "processed-request", 1, html_encode(list_to_text(csp->headers)), \
0))  {
       free_map(exports);
       return JB_ERR_MEMORY;
@@ -1387,15 +1393,16 @@
       /*
        * Unknown prefix - assume http://
        */
-      char * url_param_prefixed = malloc(7 + 1 + strlen(url_param));
+      const size_t url_param_prefixed_size = 7 + 1 + strlen(url_param);
+      char * url_param_prefixed = malloc(url_param_prefixed_size);
       if (NULL == url_param_prefixed)
       {
          free(url_param);
          free_map(exports);
          return JB_ERR_MEMORY;
       }
-      strcpy(url_param_prefixed, "http://");
-      strcpy(url_param_prefixed + 7, url_param);
+      strlcpy(url_param_prefixed, "http://", url_param_prefixed_size);
+      strlcat(url_param_prefixed, url_param, url_param_prefixed_size);
       free(url_param);
       url_param = url_param_prefixed;
    }
@@ -1504,7 +1511,7 @@
       for (i = 0; i < MAX_AF_FILES; i++)
       {
          if (NULL == csp->config->actions_file_short[i]
-             || !strcmp(csp->config->actions_file_short[i], "standard")) continue;
+             || !strcmp(csp->config->actions_file_short[i], "standard.action")) \
continue;  
          b = NULL;
          hits = 1;
@@ -1515,7 +1522,7 @@
                /* FIXME: Hardcoded HTML! */
                string_append(&matches, "<tr><th>In file: ");
                string_join  (&matches, \
                html_encode(csp->config->actions_file_short[i]));
-               snprintf(buf, 150, ".action <a class=\"cmd\" \
href=\"/show-status?file=actions&amp;index=%d\">", i); +               snprintf(buf, \
sizeof(buf), " <a class=\"cmd\" href=\"/show-status?file=actions&amp;index=%d\">", \
i);  string_append(&matches, buf);
                string_append(&matches, "View</a>");
 #ifdef FEATURE_CGI_EDIT_ACTIONS


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
ijbswa-commits mailing list
ijbswa-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ijbswa-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic