X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsrc%2Fstore.c;h=045f27f8e1218bf7ece27244ebe622f740333535;hb=14ca5d2ac6c3536fe189435269a302ef14e972cf;hp=b7cf4cdee3798503f6d60ec7d564ceaa338c5097;hpb=e2ae28ed72ed4253536367f8aad58782c7d8be18;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/store.c b/src/src/store.c index b7cf4cdee..045f27f8e 100644 --- a/src/src/store.c +++ b/src/src/store.c @@ -159,6 +159,35 @@ static void internal_store_free(void *, const char *, int linenumber); /******************************************************************************/ +/* Slower version check, for use when platform intermixes malloc and mmap area +addresses. */ + +BOOL +is_tainted_fn(const void * p) +{ +storeblock * b; +int pool; + +for (pool = 0; pool < nelem(chainbase); pool++) + if ((b = current_block[pool])) + { + char * bc = CS b + ALIGNED_SIZEOF_STOREBLOCK; + if (CS p >= bc && CS p <= bc + b->length) goto hit; + } + +for (pool = 0; pool < nelem(chainbase); pool++) + for (b = chainbase[pool]; b; b = b->next) + { + char * bc = CS b + ALIGNED_SIZEOF_STOREBLOCK; + if (CS p >= bc && CS p <= bc + b->length) goto hit; + } +return FALSE; + +hit: +return pool >= POOL_TAINT_BASE; +} + + void die_tainted(const uschar * msg, const uschar * func, int line) {