Quellcode durchsuchen

core: parser - additioal check for content lenght spanning next line

(cherry picked from commit bf6bd11a9b969c02a106f94ebf40cefbe8028456)
(cherry picked from commit ecfcab9af6f3927c9dfe170826f1cbae5d28a447)
Daniel-Constantin Mierla vor 4 Jahren
Ursprung
Commit
296ff8b988
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      src/core/parser/parse_content.c

+ 2 - 2
src/core/parser/parse_content.c

@@ -224,8 +224,8 @@ char* parse_content_length(char* const buffer, const char* const end,
 		goto error;
 	}
 	/* search the begining of the number */
-	while ( p<end && (*p==' ' || *p=='\t' ||
-	(*p=='\n' && (*(p+1)==' '||*(p+1)=='\t')) ))
+	while ( p<end && (*p==' ' || *p=='\t'
+				|| (*p=='\n' && p+1<end && (*(p+1)==' ' || *(p+1)=='\t')) ) )
 		p++;
 	if (p==end)
 		goto error;