|
@@ -33,6 +33,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
33
|
33
|
#include <strings.h>
|
34
|
34
|
#include <byteswap.h>
|
35
|
35
|
#include <errno.h>
|
|
36
|
+#include <ctype.h>
|
36
|
37
|
#include <assert.h>
|
37
|
38
|
#include <ipxe/uri.h>
|
38
|
39
|
#include <ipxe/refcnt.h>
|
|
@@ -441,7 +442,7 @@ static int http_rx_content_length ( struct http_request *http, char *value ) {
|
441
|
442
|
|
442
|
443
|
/* Parse content length */
|
443
|
444
|
content_len = strtoul ( value, &endp, 10 );
|
444
|
|
- if ( *endp != '\0' ) {
|
|
445
|
+ if ( ! ( ( *endp == '\0' ) || isspace ( *endp ) ) ) {
|
445
|
446
|
DBGC ( http, "HTTP %p invalid Content-Length \"%s\"\n",
|
446
|
447
|
http, value );
|
447
|
448
|
return -EINVAL_CONTENT_LENGTH;
|