From 3161ed55fd054b87c790e15a0dbe64e43d22718f Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 26 Nov 2020 21:38:17 +0100 Subject: [PATCH] [pvs] Possible overflow. Cast operands of the '1 << type' operator to the 'size_t' type, not the result. --- src/xbt/mmalloc/mrealloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xbt/mmalloc/mrealloc.c b/src/xbt/mmalloc/mrealloc.c index 9e9a877d07..1bdd724453 100644 --- a/src/xbt/mmalloc/mrealloc.c +++ b/src/xbt/mmalloc/mrealloc.c @@ -129,7 +129,7 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size) abort(); } - if (size > (size_t) (1 << (type - 1)) && size <= (size_t) (1 << type)) { + if (size > ((size_t)1 << (type - 1)) && size <= ((size_t)1 << type)) { /* The new size is the same kind of fragment. */ result = ptr; -- 2.20.1