Add sanity checks for slotmem size calculations:
* modules/slotmem/mod_slotmem_plain.c,
modules/slotmem/mod_slotmem_shm.c
(slotmem_size_mul, slotmem_size_add): New helper functions for
checked arithmetic on apr_size_t values.
(slotmem_create): Use checked arithmetic for allocation size
calculations to prevent integer overflow.
(slotmem_grab): Add overflow check on size * id multiplication
before pointer arithmetic.
(slotmem_get): Validate dest_len against slot size before access,
move inuse pointer dereference after bounds checks.
(slotmem_put): Validate src_len against slot size before access,
move inuse pointer dereference after bounds checks.
* modules/slotmem/mod_slotmem_shm.c (slotmem_fgrab): Add overflow
check on size * id multiplication before pointer arithmetic.
(slotmem_attach): Validate shared memory segment size against
expected size computed with checked arithmetic. Use basesize
variable for inuse pointer calculation.
Submitted by: metsw24-max <metsw24 gmail.com>
GitHub: closes #626
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1936268 13f79535-47bb-0310-9956-
ffa450edef68