[file-roller] ensure that strcmp gets non-NULL values



commit d5db489b97eafc4b56f8185f7f230bffc0f00840
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Feb 16 19:19:42 2010 +0100

    ensure that strcmp gets non-NULL values
    
    [bug #609449]

 src/main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 04b2951..abd88b6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -548,11 +548,14 @@ fr_registered_command_get_potential_capabilities (FrRegisteredCommand *reg_com,
 {
 	int i;
 
+	if (mime_type == NULL)
+		return FR_COMMAND_CAN_DO_NOTHING;
+
 	for (i = 0; i < reg_com->caps->len; i++) {
 		FrMimeTypeCap *cap;
 
 		cap = g_ptr_array_index (reg_com->caps, i);
-		if (strcmp (mime_type, cap->mime_type) == 0)
+		if ((cap->mime_type != NULL) && (strcmp (mime_type, cap->mime_type) == 0))
 			return cap->potential_capabilities;
 	}
 



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