Module: kamailio
Branch: master
Commit: bf6bd11a9b969c02a106f94ebf40cefbe8028456
URL: 
https://github.com/kamailio/kamailio/commit/bf6bd11a9b969c02a106f94ebf40cefbe8028456

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2021-09-20T07:17:27+02:00

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

---

Modified: src/core/parser/parse_content.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/bf6bd11a9b969c02a106f94ebf40cefbe8028456.diff
Patch: 
https://github.com/kamailio/kamailio/commit/bf6bd11a9b969c02a106f94ebf40cefbe8028456.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;


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to