diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-08-12 22:56:54 +0000 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-08-12 22:56:54 +0000 |
commit | 74505b8cb07c050ebb801207633ffbeed5aeced3 (patch) | |
tree | cde21be52e25d8a045ca239e283d026631f79505 | |
parent | bb5ef54033e6eb3f26007a9d8e33a643b7dd90d1 (diff) | |
parent | cb70a5616979f9632f4b12dc71c80916e8ef8196 (diff) |
Merge branch 'fix-content-length-overflow' into 'master'
prevent buffer overflow when spoofing content-length
See merge request jkaivo/blog!2
-rw-r--r-- | post.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -47,7 +47,9 @@ void read_post_data(void) int pos = 0; int c; - while ((c = getchar()) != EOF) { + buf[0] = '\0'; + + while (pos < cl && (c = getchar()) != EOF) { if (c == '&') { add_data(buf); pos = 0; |