diff mbox

[16/42] libmultipath: error checking in remove_features()

Message ID 1357653259-62650-17-git-send-email-hare@suse.de (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Hannes Reinecke Jan. 8, 2013, 1:53 p.m. UTC
An error check was missing in remove_features().

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 libmultipath/structs.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/libmultipath/structs.c b/libmultipath/structs.c
index 88e8706..049f17d 100644
--- a/libmultipath/structs.c
+++ b/libmultipath/structs.c
@@ -559,6 +559,9 @@  remove_feature(char **f, char *o)
 	 * about to be removed
 	 */
 	p = strchr(*f, ' ');
+	if (!p)
+		/* Internal error, feature string inconsistent */
+		return 1;
 	while (*p == ' ')
 		p++;
 	p--;