From 54042a74dc2c68d3214e4357d54a3c96cfa2d563 Mon Sep 17 00:00:00 2001 From: Martin Lederhilger Date: Mon, 15 Jun 2026 10:37:59 +0200 Subject: [PATCH] Fix heap corruption in the case where size is between page_size and 2 * page_size. --- private/string_map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/string_map.h b/private/string_map.h index 2d10f4b..ac26f92 100644 --- a/private/string_map.h +++ b/private/string_map.h @@ -102,7 +102,7 @@ namespace cppcms { char *allocate_space(size_t size) { - if(size * 2 > page_size_) { + if(size > page_size_) { page *p=(page *)malloc(size + sizeof(page)); if(!p) throw std::bad_alloc();