Commit 3b723c4
committed
client: perform strict chunk size parsing
We can not rely on `strtoul()` to parse hexadecimal chunk sizes as it
accepts a wider range of inputs than what is allowed by the HTTP spec.
Decode the chunk sizes manually and fix skipping chunk extension headers
while we're at it. Also ensure that there's no trailing garbage after
the size and that we bail out on overflows.
Fixes: #3
Signed-off-by: Jo-Philipp Wich <jo@mein.io>1 parent 34a8a74 commit 3b723c4
1 file changed
+48
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
407 | 453 | | |
408 | 454 | | |
409 | 455 | | |
| |||
450 | 496 | | |
451 | 497 | | |
452 | 498 | | |
453 | | - | |
454 | | - | |
455 | | - | |
| 499 | + | |
456 | 500 | | |
457 | 501 | | |
458 | 502 | | |
459 | 503 | | |
460 | | - | |
| 504 | + | |
461 | 505 | | |
462 | 506 | | |
463 | 507 | | |
| |||
0 commit comments