summaryrefslogtreecommitdiff
path: root/pjlib-util/src
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib-util/src')
-rw-r--r--pjlib-util/src/pjlib-util/scanner.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/pjlib-util/src/pjlib-util/scanner.c b/pjlib-util/src/pjlib-util/scanner.c
index df07a278..676fd026 100644
--- a/pjlib-util/src/pjlib-util/scanner.c
+++ b/pjlib-util/src/pjlib-util/scanner.c
@@ -401,9 +401,23 @@ PJ_DEF(void) pj_scan_get_newline( pj_scanner *scanner )
++scanner->line;
scanner->start_line = scanner->curptr;
- if (PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && scanner->skip_ws) {
- pj_scan_skip_whitespace(scanner);
- }
+ /**
+ * This probably is a bug, see PROTOS test #2480.
+ * This would cause scanner to incorrectly eat two new lines, e.g.
+ * when parsing:
+ *
+ * Content-Length: 120\r\n
+ * \r\n
+ * <space><space><space>...
+ *
+ * When pj_scan_get_newline() is called to parse the first newline
+ * in the Content-Length header, it will eat the second newline
+ * too because it thinks that it's a header continuation.
+ *
+ * if (PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && scanner->skip_ws) {
+ * pj_scan_skip_whitespace(scanner);
+ * }
+ */
}