[grilo] pls: Avoid NULL dereference



commit 532b3083eb5aa18ac276a140324f43fa444a8d2f
Author: Bastien Nocera <hadess hadess net>
Date:   Tue May 26 12:41:58 2015 +0200

    pls: Avoid NULL dereference
    
    From coverity:
    libs/pls/grl-pls.c:624: var_deref_op: Dereferencing null pointer "valid_entries".
    
    valid_entries can be NULL, so check its value before using it in the
    debug output.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749887

 libs/pls/grl-pls.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libs/pls/grl-pls.c b/libs/pls/grl-pls.c
index f03c4ac..8f353b0 100644
--- a/libs/pls/grl-pls.c
+++ b/libs/pls/grl-pls.c
@@ -622,7 +622,7 @@ grl_pls_browse_report_results (GrlSourceBrowseSpec *bs)
   }
 
   GRL_DEBUG ("%s, skip: %d, count: %d, remaining: %d, num entries: %d",
-             __FUNCTION__, skip, count, remaining, valid_entries->len);
+             __FUNCTION__, skip, count, remaining, valid_entries ? valid_entries->len : 0);
 
   if (remaining) {
     int i;


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