patch-libhttpd_protocol_c 1.7 KB

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