#define Ustrtoul(s,t,b) strtoul(CCS(s),CSS(t),b)
#define Uunlink(s) unlink(CCS(s))
-extern BOOL is_tainted(const void *);
extern void die_tainted(const uschar *, const uschar *, int);
+/* Predicate: if an address is in a tainted pool.
+By extension, a variable pointing to this address is tainted.
+*/
+
+static inline BOOL
+is_tainted(const void * p)
+{
+extern void * tainted_base, * tainted_top;
+return p >= tainted_base && p < tainted_top;
+}
+
static inline uschar * __Ustrcat(uschar * dst, const uschar * src, const char * func, int line)
{
#ifndef COMPILE_UTILITY
if (statbuf.st_size > 8192)
{
rmark r = store_mark();
- store_get((int)statbuf.st_size, FALSE);
+ void * dummy = store_get((int)statbuf.st_size, FALSE);
store_reset(r);
}
a fast is_tainted implementation. We assume the kernel only allocates mmaps using
one side or the other of data+heap, not both. */
-static void * tainted_base = (void *)-1;
-static void * tainted_top = (void *)0;
+void * tainted_base = (void *)-1;
+void * tainted_top = (void *)0;
/* pool_malloc holds the amount of memory used by the store pools; this goes up
and down as store is reset or released. nonpool_malloc is the total got by
/******************************************************************************/
-/* Predicate: if an address is in a tainted pool.
-By extension, a variable pointing to this address is tainted.
-*/
-
-BOOL
-is_tainted(const void * p)
-{
-BOOL rc = p >= tainted_base && p < tainted_top;
-
-#ifndef COMPILE_UTILITY
-DEBUG(D_memory) if (rc) debug_printf_indent("is_tainted: YES\n");
-#endif
-return rc;
-}
-
void
die_tainted(const uschar * msg, const uschar * func, int line)
{
/* The real functions */
typedef void ** rmark;
-extern BOOL is_tainted(const void *);
extern BOOL store_extend_3(void *, BOOL, int, int, const char *, int);
extern void store_free_3(void *, const char *, int);
extern void *store_get_3(int, BOOL, const char *, int) ALLOC ALLOC_SIZE(1) WARN_UNUSED_RESULT;