Parse Content-Range with missing right hand side

Fixes #144
This commit is contained in:
Justine Tunney 2021-04-01 18:51:12 -07:00
parent 7abca1531f
commit 83abd68029
6 changed files with 59 additions and 26 deletions

View file

@ -26,7 +26,7 @@
*/
ssize_t ParseContentLength(const char *s, size_t n) {
int i, r = 0;
if (!n) return -1;
if (!n) return 0;
for (i = 0; i < n; ++i) {
if (!isdigit(s[i])) return -1;
if (__builtin_mul_overflow(r, 10, &r)) return -1;