Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/proxy/proxy_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ PROXY_DECLARE(char *)ap_proxy_canonenc_ex(apr_pool_t *p, const char *x, int len,
reserved = "";
}

ap_assert(len >= 0 && len <= (INT_MAX - 1) / 3);
y = apr_palloc(p, 3 * len + 1);

for (i = 0, j = 0; i < len; i++, j++) {
Expand Down
1 change: 1 addition & 0 deletions server/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,7 @@ AP_DECLARE(char *) ap_make_full_path(apr_pool_t *a, const char *src1,
/* allocate +3 for '/' delimiter, trailing NULL and overallocate
* one extra byte to allow the caller to add a trailing '/'
*/
ap_assert(len2 <= APR_SIZE_MAX - 3 && len1 <= APR_SIZE_MAX - 3 - len2);
path = (char *)apr_palloc(a, len1 + len2 + 3);
if (len1 == 0) {
*path = '/';
Expand Down