X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/fa1c8faf169384bebaa8d172f491574c45ae2aa4..b4e7527561f1c68b821d5cf25efe29ae63d1d434:/src/src/exim.c diff --git a/src/src/exim.c b/src/src/exim.c index 4473373b3..e5b72f11a 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -49,6 +49,8 @@ optimize out the tail recursion and so not make them too expensive. */ static void * function_store_malloc(PCRE2_SIZE size, void * tag) { +if (size > INT_MAX) + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "excessive memory alloc request"); return store_malloc((int)size); } @@ -63,12 +65,15 @@ if (block) store_free(block); static void * function_store_get(PCRE2_SIZE size, void * tag) { +if (size > INT_MAX) + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "excessive memory alloc request"); return store_get((int)size, GET_UNTAINTED); /* loses track of taint */ } static void function_store_nullfree(void * block, void * tag) { +/* We cannot free memory allocated using store_get() */ } @@ -3688,7 +3693,7 @@ on the second character (the one after '-'), to save some effort. */ in all cases provided there are no further characters in this argument. */ - alloc_onetime_qrunner(); + if (!qrunners) alloc_onetime_qrunner(); qrunners->queue_2stage = f.queue_2stage; if (*argrest) for (int i = 0; i < nelem(rsopts); i++)