Repository navigation
Conversation
|
I think the overflow checks need to use the range of |
Makes sense, thanks for the review! Will do |
* server/util.c (ap_size_parameter_parse): Allow an optional case-insensitive 'b', 'k', 'm' or 'g' suffix, bounding the multiplication by the range of apr_off_t. * include/httpd.h: Update doxygen accordingly. * modules/filters/mod_substitute.c (set_max_line_length): Use ap_size_parameter_parse(). * test/unit/util.c (size_parameter_parse_handles_suffixes): New test. * test/modules/core/test_012_config_off_t.py: Update for suffix support. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ap_size_parameter_parse(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ap_size_parameter_parse()now accepts an optional case-insensitiveb,kormsuffix (bytes, ×1024, ×1024×1024) after the number, rejecting overflow withAPR_ERANGE. Size-valued directives using it, such asLimitRequestBody,ScriptLogLength,ScriptLogBuffer,DavQuota,BufferSizeandAuthFormSize, thereby take the same suffixesAuthDigestShmemSizealready did.A second commit converts mod_auth_digest's
set_shmem_size()to the shared parser. Parsing is strict: anything after the suffix is rejected, including trailing whitespace (only reachable via a quoted argument), whichset_shmem_size()previously tolerated.Unit tests added in
test/unit/util.c.🤖 Generated with Claude Code