Skip to contentSkip to conversation

tiny bug

PATCH Applied Benjamin Marzinski 2 participants 2 messages Jul 18, 2005 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

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

libmultipath/util.c +2 -0
diff -urpN mp-devel/libmultipath/util.c mp-devel-patched/libmultipath/util.c
@@ -59,6 +59,8 @@ get_word (char * sentence, char ** word)
 	int len;
 	int skip = 0;
 	
+	if (word)
+		*word = NULL;	
 	while (*sentence ==  ' ') {
 		sentence++;
 		skip++;
#1 lore raw
Quoted 6 lines · Benjamin Marzinski

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.

Applied, thanks.

Signature · 1 line
christophe varoqui <[email protected]>