From 9da0319c15be3600f7875852c38b75e21ee99a69 Mon Sep 17 00:00:00 2001 From: Fix Date: Mon, 29 May 2023 11:17:44 +0200 Subject: [PATCH] Bullet forces C++, so ensure the qboolean variants, when that happens --- plugins/plugin.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/plugin.c b/plugins/plugin.c index fa6f2137a..76266eaa9 100644 --- a/plugins/plugin.c +++ b/plugins/plugin.c @@ -264,19 +264,31 @@ qboolean ZF_ReallocElements(void **ptr, size_t *elements, size_t newelements, si //protect against malicious overflows if (newelements > SIZE_MAX / elementsize) +#ifdef __cplusplus + return qfalse; +#else return false; +#endif oldsize = *elements * elementsize; newsize = newelements * elementsize; n = plugfuncs->Realloc(*ptr, newsize); if (!n) +#ifdef __cplusplus + return qfalse; +#else return false; +#endif if (newsize > oldsize) memset((char*)n+oldsize, 0, newsize - oldsize); *elements = newelements; *ptr = n; - return true; +#ifdef __cplusplus + return qtrue; +#else + return true; +#endif }