Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[pvs] Possible overflow. Cast operands of the '1 << type' operator to the 'size_t...
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 26 Nov 2020 20:38:17 +0000 (21:38 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 26 Nov 2020 22:43:57 +0000 (23:43 +0100)
src/xbt/mmalloc/mrealloc.c

index 9e9a877..1bdd724 100644 (file)
@@ -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;