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

[dm-devel] tiny bug



mulitpathd was crashing when I entered an empty line at the CLI prompt, because
the output buffer from get_word was being checked to see if it was NULL, but
get_word never explicitly sets the buffer to NULL if there is no word.

The patch fixes this.

-Ben
diff -urpN mp-devel/libmultipath/util.c mp-devel-patched/libmultipath/util.c
--- mp-devel/libmultipath/util.c	2005-06-20 18:00:23.000000000 -0500
+++ mp-devel-patched/libmultipath/util.c	2005-07-18 14:28:18.332453696 -0500
@@ -59,6 +59,8 @@ get_word (char * sentence, char ** word)
 	int len;
 	int skip = 0;
 	
+	if (word)
+		*word = NULL;	
 	while (*sentence ==  ' ') {
 		sentence++;
 		skip++;

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