about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2011-07-18 16:32:45 +0000
committerMarco Peereboom <marco@conformal.com>2011-07-18 16:32:45 +0000
commitc54ab7df88ee7c00c8e6e1703303db0b1e0b6a19 (patch)
tree658ffe1de1ecfdbf62453f6a38033caf5c616bc2
parent2ff98b9a8a3934e013b147137c753ae41ec106a2 (diff)
downloadxombrero-c54ab7df88ee7c00c8e6e1703303db0b1e0b6a19.tar.gz
Fix a logic bug in add_mime_type() that could result in a NULL pointer
dereference in case of invalid parameters.

From: Fabian Keil <fk@fabiankeil.de>
-rw-r--r--xxxterm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xxxterm.c b/xxxterm.c
index cc4d1b5..b33ee11 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -1591,7 +1591,7 @@ add_mime_type(struct settings *s, char *line)
 
 	/* XXX this could be smarter */
 
-	if (line == NULL && strlen(line) == 0) {
+	if (line == NULL || strlen(line) == 0) {
 		show_oops(NULL, "add_mime_type invalid parameters");
 		return (1);
 	}