X-Git-Url: https://vcs.fsf.org/?p=exim.git;a=blobdiff_plain;f=src%2Fsrc%2Flookups%2Fjson.c;h=f476db3d97d276fcc78fa57757686954c58e2443;hp=a02b7b9bdd0ea760d188f8568361840d3990d799;hb=d447dbd160a0fb503ed1e763f3f23d28744b6ddd;hpb=42c7f0b4ea09d8971a19beeef743ec8981d4aacc diff --git a/src/src/lookups/json.c b/src/src/lookups/json.c index a02b7b9bd..f476db3d9 100644 --- a/src/src/lookups/json.c +++ b/src/src/lookups/json.c @@ -16,12 +16,14 @@ which is freed once by search_tidyup(). Make the free call a dummy. This burns some 300kB in handling a 37kB JSON file, for the benefit of a fast free. The alternative of staying with malloc is nearly as bad, eyeballing the activity there are 20% the number of free vs. alloc -calls (before the big bunch at the end). */ +calls (before the big bunch at the end). + +Assume that the file is trusted, so no tainting */ static void * json_malloc(size_t nbytes) { -void * p = store_get((int)nbytes); +void * p = store_get((int)nbytes, FALSE); /* debug_printf("%s %d: %p\n", __FUNCTION__, (int)nbytes, p); */ return p; } @@ -38,7 +40,7 @@ json_free(void * p) /* See local README for interface description */ static void * -json_open(uschar *filename, uschar **errmsg) +json_open(const uschar * filename, uschar ** errmsg) { FILE * f; @@ -61,7 +63,7 @@ return f; *************************************************/ static BOOL -json_check(void *handle, uschar *filename, int modemask, uid_t *owners, +json_check(void *handle, const uschar *filename, int modemask, uid_t *owners, gid_t *owngroups, uschar **errmsg) { return lf_check_file(fileno((FILE *)handle), filename, S_IFREG, modemask, @@ -77,8 +79,8 @@ return lf_check_file(fileno((FILE *)handle), filename, S_IFREG, modemask, /* See local README for interface description */ static int -json_find(void *handle, uschar *filename, const uschar *keystring, int length, - uschar **result, uschar **errmsg, uint *do_cache) +json_find(void * handle, const uschar * filename, const uschar * keystring, + int length, uschar ** result, uschar ** errmsg, uint * do_cache) { FILE * f = handle; json_t * j, * j0;