Repository navigation
Conversation
|
The overflow guard itself looks correct. I reproduced the range difference on current trunk: with a 64-bit The current three tests also pass on unmodified trunk, so they do not exercise the behavior changed here. Could you add a positive regression case that fails with the old The comment above The remaining RFC 9112 requires recipients to handle potentially large hexadecimal chunk sizes without integer-conversion overflow or precision loss; the new pre-shift check preserves that property while extending the accepted range. |
Trunk already prevents the signed left shift in
parse_chunk_size()by limiting significant hex digits tosizeof(apr_off_t) * 8 - 4bits. That also rejects positive chunk sizes whose highest hex digit would fit in a signedapr_off_t(for example, a 16-digit size below0x8000000000000000on a 64-bit build).Use the full-width digit budget and check the accumulated prefix before each four-bit shift. The guard rejects a prefix that would shift into the sign bit; the existing
APR_ENOSPCpath still returns HTTP 413 for oversized values. Add three pyhttpd raw-socket cases for the first high-bit value, all-one hex digits, and leading zeroes.Validation
git diff --checkand Python syntax compilation passed.test/modules/http1120 passed, 2 skipped; the high-bit reproducer produced no ASan/UBSan diagnostic.README.CHANGESexempts fixes for regressions that existed only on trunk, so this draft has no changes entry.test/modules/http1.