[libgdata] youtube: Add a missing strv NULL dereference check



commit f6f4e3e5eb75d1f17eb1fa9cc8aa3c9b31bb38f1
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun May 3 12:07:59 2015 +0100

    youtube: Add a missing strv NULL dereference check
    
    Spotted by Coverity.
    
    CID: #109874

 gdata/services/youtube/gdata-youtube-video.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gdata/services/youtube/gdata-youtube-video.c b/gdata/services/youtube/gdata-youtube-video.c
index 6ce6677..130499d 100644
--- a/gdata/services/youtube/gdata-youtube-video.c
+++ b/gdata/services/youtube/gdata-youtube-video.c
@@ -1722,7 +1722,7 @@ strv_contains (const gchar * const *strv, const gchar *key)
 {
        guint i;
 
-       for (i = 0; strv[i] != NULL; i++) {
+       for (i = 0; strv != NULL && strv[i] != NULL; i++) {
                if (g_strcmp0 (strv[i], key) == 0) {
                        return TRUE;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]