This patch prevents multipath from crashing on invalid
configuration file when mandatory configuration values
are missing.
References: bnc#540118
Signed-off-by: Leonardo Chiquitto <lchiquitto@novell.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
set_value(vector strvec)
{
char *str = VECTOR_SLOT(strvec, 1);
- int size = strlen(str);
+ size_t size;
int i = 0;
int len = 0;
char *alloc = NULL;
char *tmp;
+ if (!str)
+ return NULL;
+
+ size = strlen(str);
+ if (size == 0)
+ return NULL;
+
if (*str == '"') {
for (i = 2; i < VECTOR_SIZE(strvec); i++) {
str = VECTOR_SLOT(strvec, i);