From aa18915d61a805701c022e25371336cb1893737d Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 21 May 2023 00:15:58 +0200 Subject: [PATCH] Fix overflow computation --- m-string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m-string.h b/m-string.h index 5a9f3122..6c3b1158 100644 --- a/m-string.h +++ b/m-string.h @@ -326,7 +326,7 @@ m_str1ng_fit2size (m_string_t v, size_t size_alloc) // Insufficient current allocation to store the new string // Perform an allocation on the heap. size_t alloc = size_alloc + size_alloc / 2; - if (M_UNLIKELY_NOMEM (alloc <= old_alloc)) { + if (M_UNLIKELY_NOMEM (alloc <= size_alloc)) { /* Overflow in alloc computation */ M_MEMORY_FULL(sizeof (char) * alloc); // NOTE: Return is currently broken.