[discident-glib] lib: Don't crash if the query answer is empty



commit 50c7bc083802413387352d612bfcf740f79234e2
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Dec 6 00:29:14 2012 +0100

    lib: Don't crash if the query answer is empty

 discident-glib/discident-ean-glib.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/discident-glib/discident-ean-glib.c b/discident-glib/discident-ean-glib.c
index 20b48b7..3e90a4d 100644
--- a/discident-glib/discident-ean-glib.c
+++ b/discident-glib/discident-ean-glib.c
@@ -239,6 +239,9 @@ parse_lookup_response (const char *response,
 	xmlDocPtr doc;
 	xmlChar *title, *img_url;
 
+	if (response == NULL)
+		return FALSE;
+
 	doc = xmlParseMemory (response, strlen (response));
 	if (doc == NULL)
 		doc = xmlRecoverMemory (response, strlen (response));



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