You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Mark Cox <mj...@hyperreal.com> on 1996/04/15 13:28:04 UTC
cvs commit: apache/src httpd.h util.c util_script.c
mjc 96/04/15 04:28:04
Modified: src httpd.h util.c util_script.c
Log:
Submitted by: Sameer Parekh (sameer@c2.org)
If a null argument (i.e. ++) was passed to a CGI script
it wasn't passed as a blank string, it was just ignored
Revision Changes Path
1.16 +1 -0 apache/src/httpd.h
Index: httpd.h
===================================================================
RCS file: /export/home/cvs/apache/src/httpd.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -C3 -r1.15 -r1.16
*** httpd.h 1996/04/04 15:10:25 1.15
--- httpd.h 1996/04/15 11:28:01 1.16
***************
*** 486,491 ****
--- 486,492 ----
/* String handling */
char *getword(pool *p, char **line, char stop);
+ char *getword_nulls (pool *p, char **line, char stop);
char *getword_conf (pool *p, char **line);
int is_url(char *u);
1.8 +20 -0 apache/src/util.c
Index: util.c
===================================================================
RCS file: /export/home/cvs/apache/src/util.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C3 -r1.7 -r1.8
*** util.c 1996/04/05 09:39:14 1.7
--- util.c 1996/04/15 11:28:02 1.8
***************
*** 355,360 ****
--- 355,380 ----
return res;
}
+ char *getword_nulls(pool* atrans, char **line, char stop) {
+ int pos = ind(*line, stop);
+ char *res;
+
+ if (pos == -1) {
+ res = pstrdup (atrans, *line);
+ *line += strlen (*line);
+ return res;
+ }
+
+ res = palloc(atrans, pos + 1);
+ strncpy (res, *line, pos);
+ res[pos] = '\0';
+
+ ++pos;
+
+ *line += pos;
+
+ return res;
+ }
/* Get a word, (new) config-file style --- quoted strings and backslashes
* all honored
1.11 +1 -1 apache/src/util_script.c
Index: util_script.c
===================================================================
RCS file: /export/home/cvs/apache/src/util_script.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C3 -r1.10 -r1.11
*** util_script.c 1996/04/14 21:46:12 1.10
--- util_script.c 1996/04/15 11:28:02 1.11
***************
*** 83,89 ****
av[0] = av0;
for(x=1;x<n;x++) {
! w = getword(p, &args, '+');
unescape_url(w);
av[x] = escape_shell_cmd(p, w);
}
--- 83,89 ----
av[0] = av0;
for(x=1;x<n;x++) {
! w = getword_nulls(p, &args, '+');
unescape_url(w);
av[x] = escape_shell_cmd(p, w);
}