aboutsummaryrefslogtreecommitdiff
path: root/networking/httpd_indexcgi.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-09-10 21:24:45 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-09-10 21:24:45 +0200
commitdb4a67628d4e4418d01bbba1c8603a6ca8c3562e (patch)
treef45e2f496d7d7c999dbfb03141ce084d2569f425 /networking/httpd_indexcgi.c
parent33d8d08f7818a6d10e14ad8397c61adfcd377a6f (diff)
downloadbusybox-w32-db4a67628d4e4418d01bbba1c8603a6ca8c3562e.tar.gz
busybox-w32-db4a67628d4e4418d01bbba1c8603a6ca8c3562e.tar.bz2
busybox-w32-db4a67628d4e4418d01bbba1c8603a6ca8c3562e.zip
networking/httpd_ssi.c: new example CGI handler
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/httpd_indexcgi.c')
-rw-r--r--networking/httpd_indexcgi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/networking/httpd_indexcgi.c b/networking/httpd_indexcgi.c
index 94c6a692a..2605ad1bc 100644
--- a/networking/httpd_indexcgi.c
+++ b/networking/httpd_indexcgi.c
@@ -28,7 +28,8 @@ httpd_indexcgi.c -o index.cgi
28/* We don't use printf, as it pulls in >12 kb of code from uclibc (i386). */ 28/* We don't use printf, as it pulls in >12 kb of code from uclibc (i386). */
29/* Currently malloc machinery is the biggest part of libc we pull in. */ 29/* Currently malloc machinery is the biggest part of libc we pull in. */
30/* We have only one realloc and one strdup, any idea how to do without? */ 30/* We have only one realloc and one strdup, any idea how to do without? */
31/* Size (i386, approximate): 31
32/* Size (i386, static uclibc, approximate):
32 * text data bss dec hex filename 33 * text data bss dec hex filename
33 * 13036 44 3052 16132 3f04 index.cgi 34 * 13036 44 3052 16132 3f04 index.cgi
34 * 2576 4 2048 4628 1214 index.cgi.o 35 * 2576 4 2048 4628 1214 index.cgi.o
@@ -210,7 +211,7 @@ static void fmt_04u(/*char *dst,*/ unsigned n)
210 fmt_02u(n % 100); 211 fmt_02u(n % 100);
211} 212}
212 213
213int main(void) 214int main(int argc, char *argv[])
214{ 215{
215 dir_list_t *dir_list; 216 dir_list_t *dir_list;
216 dir_list_t *cdir; 217 dir_list_t *cdir;
@@ -225,6 +226,7 @@ int main(void)
225 QUERY_STRING = getenv("QUERY_STRING"); 226 QUERY_STRING = getenv("QUERY_STRING");
226 if (!QUERY_STRING 227 if (!QUERY_STRING
227 || QUERY_STRING[0] != '/' 228 || QUERY_STRING[0] != '/'
229 || strstr(QUERY_STRING, "//")
228 || strstr(QUERY_STRING, "/../") 230 || strstr(QUERY_STRING, "/../")
229 || strcmp(strrchr(QUERY_STRING, '/'), "/..") == 0 231 || strcmp(strrchr(QUERY_STRING, '/'), "/..") == 0
230 ) { 232 ) {