]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Let's bit a bit safer when dereferencing pointers.
authorWilliam King <william.king@quentustech.com>
Sat, 25 May 2013 03:03:19 +0000 (20:03 -0700)
committerWilliam King <william.king@quentustech.com>
Sat, 25 May 2013 03:03:19 +0000 (20:03 -0700)
src/mod/endpoints/mod_rtmp/libamf/src/amf0.c

index 16f1f714759cf8688e1e2e41c21c1755f2ffd753..f5c0a225266e0f705fa80773f75f495c20f29c74 100644 (file)
@@ -851,7 +851,9 @@ amf0_data * amf0_object_get(amf0_data * data, const char * name) {
                 return (node != NULL) ? node->data : NULL;
             }
             /* we have to skip the element data to reach the next name */
-            node = node->next->next;
+           if ( node != NULL && node->next != NULL ) {
+             node = node->next->next;
+           }
         }
     }
     return NULL;
@@ -870,7 +872,9 @@ amf0_data * amf0_object_set(amf0_data * data, const char * name, amf0_data * ele
                 }
             }
             /* we have to skip the element data to reach the next name */
-            node = node->next->next;
+           if ( node != NULL && node->next != NULL ) {
+             node = node->next->next;
+           }
         }
     }
     return NULL;