From dfbc1757765799bac89b29fe0f1169c1d4a7125a Mon Sep 17 00:00:00 2001 From: William King Date: Fri, 24 May 2013 20:03:19 -0700 Subject: [PATCH] Let's bit a bit safer when dereferencing pointers. --- src/mod/endpoints/mod_rtmp/libamf/src/amf0.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c b/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c index 16f1f71475..f5c0a22526 100644 --- a/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c +++ b/src/mod/endpoints/mod_rtmp/libamf/src/amf0.c @@ -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;