Ensure we don't dereference a null pointer.
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 29 Sep 2009 06:50:35 +0000 (06:50 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 29 Sep 2009 06:50:35 +0000 (06:50 +0000)
Made emem_canary() static.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30186 f5534014-38df-0310-8fa8-9805f1628bb7

epan/emem.c

index 991704fce4b69c4a39a97faba20a482e40b5d15f..c40ddf2c1f496f6ec2fe9568182826f0cec502aa 100644 (file)
@@ -147,7 +147,7 @@ static intptr_t pagesize;
 /*
  * Set a canary value to be placed between memchunks.
  */
-void
+static void
 emem_canary(guint8 *canary) {
        int i;
        static GRand   *rand_state = NULL;
@@ -903,6 +903,10 @@ emem_tree_lookup32_le(emem_tree_t *se_tree, guint32 key)
        }
 
 
+       if(!node){
+               return NULL;
+       }
+
        /* If we are still at the root of the tree this means that this node
         * is either smaller than the search key and then we return this
         * node or else there is no smaller key available and then