[sr-dev] git:5.5:ecfcab9a: core: parser - additioal check for content lenght spanning next line

Daniel-Constantin Mierla miconda at gmail.com
Wed Sep 22 08:41:56 CEST 2021


Module: kamailio
Branch: 5.5
Commit: ecfcab9af6f3927c9dfe170826f1cbae5d28a447
URL: https://github.com/kamailio/kamailio/commit/ecfcab9af6f3927c9dfe170826f1cbae5d28a447

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-09-22T08:39:47+02:00

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

(cherry picked from commit bf6bd11a9b969c02a106f94ebf40cefbe8028456)

---

Modified: src/core/parser/parse_content.c

---

Diff:  https://github.com/kamailio/kamailio/commit/ecfcab9af6f3927c9dfe170826f1cbae5d28a447.diff
Patch: https://github.com/kamailio/kamailio/commit/ecfcab9af6f3927c9dfe170826f1cbae5d28a447.patch

---

diff --git a/src/core/parser/parse_content.c b/src/core/parser/parse_content.c
index cda4b8177d..aff70f8660 100644
--- a/src/core/parser/parse_content.c
+++ b/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;




More information about the sr-dev mailing list