summaryrefslogtreecommitdiff
path: root/package/wifidog/patches/patch-libhttpd_protocol_c
blob: 6770fc7296a3c26365a19511a69f633361d24d76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
--- wifidog-1.1.5.orig/libhttpd/protocol.c	2007-11-01 21:04:20.000000000 +0100
+++ wifidog-1.1.5/libhttpd/protocol.c	2014-01-01 16:29:50.000000000 +0100
@@ -22,6 +22,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <time.h>
@@ -83,7 +84,7 @@ int _httpd_readChar(request *r, char *cp
 {
 	if (r->readBufRemain == 0)
 	{
-		bzero(r->readBuf, HTTP_READ_BUF_LEN + 1);
+		memset(r->readBuf, 0, HTTP_READ_BUF_LEN + 1);
 		r->readBufRemain = _httpd_net_read(r->clientSock, 
 			r->readBuf, HTTP_READ_BUF_LEN);
 		if (r->readBufRemain < 1)
@@ -352,7 +353,7 @@ void _httpd_storeData(request *r, char *
 	
 	cp = query;
 	cp2 = var;
-        bzero(var, strlen(query));
+        memset(var, 0, strlen(query));
 	val = NULL;
         while(*cp)
         {
@@ -483,7 +484,7 @@ httpDir *_httpd_findContentDir(server, d
 			if (createFlag == HTTP_TRUE)
 			{
 				curChild = malloc(sizeof(httpDir));
-				bzero(curChild, sizeof(httpDir));
+				memset(curChild, 0, sizeof(httpDir));
 				curChild->name = strdup(curDir);
 				curChild->next = curItem->children;
 				curItem->children = curChild;
@@ -606,7 +607,7 @@ void _httpd_sendFile(httpd *server, requ
 	char	*suffix;
 	struct 	stat sbuf;
 
-	suffix = rindex(path, '.');
+	suffix = strrchr(path, '.');
 	if (suffix != NULL)
 	{
 		if (strcasecmp(suffix,".gif") == 0) 
@@ -699,7 +700,7 @@ char *_httpd_escape(str)
         if (!ACCEPTABLE((unsigned char)*p))
                 unacceptable +=2;
     result = (char *) malloc(p-str + unacceptable + 1);
-    bzero(result,(p-str + unacceptable + 1));
+    memset(result, 0, (p-str + unacceptable + 1));
 
     if (result == NULL)
     {