diff options
author | Jens Georg <mail@jensge.org> | 2014-05-31 09:45:55 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2014-05-31 09:46:31 +0200 |
commit | 8e0e8148675925767be7bedf81e6c4e8185d1be5 (patch) | |
tree | 832f9f320a80f2c19034ce678bcc1daafb323a7e | |
parent | 61e4a2a287e5fa973161740ecc68227c3aeb5396 (diff) | |
download | gupnp-av-8e0e8148675925767be7bedf81e6c4e8185d1be5.tar.gz |
Add null checks
Fixes coverity issue 60869
Signed-off-by: Jens Georg <mail@jensge.org>
https://bugzilla.gnome.org/show_bug.cgi?id=731033
-rw-r--r-- | libgupnp-av/fragment-util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libgupnp-av/fragment-util.c b/libgupnp-av/fragment-util.c index ad15d53..6fc6be2 100644 --- a/libgupnp-av/fragment-util.c +++ b/libgupnp-av/fragment-util.c @@ -699,20 +699,20 @@ fragment_util_check_fragments (DocNode *original, XML_PARSE_NONET); GUPnPDIDLLiteFragmentResult result; - if (current_doc == NULL) { + if (current_doc == NULL || current_doc->children == NULL) { result = GUPNP_DIDL_LITE_FRAGMENT_RESULT_CURRENT_BAD_XML; goto out; } - if (new_doc == NULL) { + + if (new_doc == NULL || new_doc->children == NULL) { result = GUPNP_DIDL_LITE_FRAGMENT_RESULT_NEW_BAD_XML; goto out; } /* Assuming current_doc->children is non-NULL. */ - if (current_doc->children != NULL && - current_doc->children->children != NULL) { + if (current_doc->children->children != NULL) { /* If the child element is title or class, * it must not be set to empty or removed. */ |