]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
tmqh: fix possible null dereference
authorPhilippe Antoine <contact@catenacyber.fr>
Tue, 15 Mar 2022 19:59:28 +0000 (20:59 +0100)
committerVictor Julien <vjulien@oisf.net>
Fri, 25 Mar 2022 06:46:16 +0000 (07:46 +0100)
Coverity ID: 1502953

As we check just on the next line my_pool against NULL, we should
not dereference it, even for debug validation

src/tmqh-packetpool.c

index 3b84f3608175d43d48898c7597cb44371890615f..3ca5d87c0b893b6b60c7ed5c7eedb3f72ef42b56 100644 (file)
@@ -338,7 +338,7 @@ void PacketPoolDestroy(void)
     PktPool *my_pool = GetThreadPacketPool();
 
 #ifdef DEBUG_VALIDATION
-    BUG_ON(my_pool->destroyed);
+    BUG_ON(my_pool && my_pool->destroyed);
 #endif /* DEBUG_VALIDATION */
 
     if (my_pool && my_pool->pending_pool != NULL) {