From af6ee27c0d6a87d0274b9e83a55f78176ab95da4 Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Fri, 3 Dec 2021 12:06:16 -0800 Subject: [PATCH] Enforce abort_conf:true when malloc_conf is not fully recognized. Ensures the malloc_conf "ends with key", "ends with comma" and "malform conf string" cases abort under abort_conf:true. --- src/jemalloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/jemalloc.c b/src/jemalloc.c index a9d7c166..a7d43dc1 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -845,10 +845,12 @@ malloc_conf_next(char const **opts_p, char const **k_p, size_t *klen_p, if (opts != *opts_p) { malloc_write(": Conf string ends " "with key\n"); + had_conf_error = true; } return true; default: malloc_write(": Malformed conf string\n"); + had_conf_error = true; return true; } } @@ -867,6 +869,7 @@ malloc_conf_next(char const **opts_p, char const **k_p, size_t *klen_p, if (*opts == '\0') { malloc_write(": Conf string ends " "with comma\n"); + had_conf_error = true; } *vlen_p = (uintptr_t)opts - 1 - (uintptr_t)*v_p; accept = true;