X-Git-Url: http://git.samba.org/samba.git/?a=blobdiff_plain;f=source4%2Fweb_server%2Fweb_server.c;h=a1db34be21a83b7c7f42bb3d2eff8d6b550e17bb;hb=2b2ff12e706d999ff2d84affa79c64b33cc289a7;hp=7c2717368e3120bc38215e33daf981e05930a551;hpb=58e2c1534429c05adb0cf5957d281dca0286fc13;p=nivanova%2Fsamba-autobuild%2F.git diff --git a/source4/web_server/web_server.c b/source4/web_server/web_server.c index 7c2717368e3..a1db34be21a 100644 --- a/source4/web_server/web_server.c +++ b/source4/web_server/web_server.c @@ -107,6 +107,8 @@ void websrv_output(struct websrv_context *web, const void *data, size_t length) */ NTSTATUS http_parse_header(struct websrv_context *web, const char *line) { + int error = 0; + if (line[0] == 0) { web->input.end_of_headers = true; } else if (strncasecmp(line,"GET ", 4)==0) { @@ -118,7 +120,10 @@ NTSTATUS http_parse_header(struct websrv_context *web, const char *line) http_error(web, "400 Bad request", "This server only accepts GET and POST requests"); return NT_STATUS_INVALID_PARAMETER; } else if (strncasecmp(line, "Content-Length: ", 16)==0) { - web->input.content_length = strtoul(&line[16], NULL, 10); + web->input.content_length = strtoul_err(&line[16], NULL, 10, &error); + if (error != 0) { + return NT_STATUS_INVALID_PARAMETER; + } } else { struct http_header *hdr = talloc_zero(web, struct http_header); char *colon = strchr(line, ':');