summaryrefslogtreecommitdiff
path: root/lib/darr.h
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2024-01-11 15:38:58 +0000
committerChristian Hopps <chopps@labn.net>2024-01-11 18:14:58 +0000
commit29f2a300a328974146230c320ef63d047a679e81 (patch)
tree58cedcb420b377c414315075bbdf0d6de5b2fe89 /lib/darr.h
parent67e8ef293f03b2dfd52981c7d82fbc98716fa1e5 (diff)
lib: fix coverity issues
** CID 1575504: Insecure data handling (TAINTED_SCALAR) (maybe) ** CID 1575505: Integer handling issues (CONSTANT_EXPRESSION_RESULT) ** CID 1575506: Integer handling issues (CONSTANT_EXPRESSION_RESULT) ** CID 1575507: Null pointer dereferences (REVERSE_INULL) Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/darr.h')
-rw-r--r--lib/darr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/darr.h b/lib/darr.h
index df8ace62dd..404869d9a2 100644
--- a/lib/darr.h
+++ b/lib/darr.h
@@ -291,7 +291,7 @@ void *__darr_resize(void *a, uint count, size_t esize, struct memtype *mt);
*/
#define darr_ensure_i_mt(A, I, MT) \
({ \
- assert((int)(I) >= 0 && (int)(I) <= INT_MAX); \
+ assert((int)(I) >= 0 && (uint)(I) <= INT_MAX); \
int _i = (int)(I); \
if (_i > darr_maxi(A)) \
_darr_resize_mt((A), _i + 1, MT); \