multipath-tools fixes
cover multipath-tools fixes
Here are two fixes for the multipathd. The first one fixes a potential memory corruption; the second one fixes a segfault in the interactive client.
Christof
PATCH 1/2 multipath-tools: Assign correct pointer from REALLOC
From: Christof Schmitt <[email protected]>
Assign the pointer returned from REALLOC to v->slot; this is the memory area to be changed.
Signed-off-by Christof Schmitt <[email protected]>
--- libmultipath/vector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/vector.c +1 -1
@@ -96,7 +96,7 @@ vector_del_slot(vector v, int slot) v->slot =NULL ; }else - v =REALLOC (v->slot,sizeof (void *) * v->allocated); + v->slot =REALLOC (v->slot,sizeof (void *) * v->allocated); }void
PATCH 2/2 multipath-tools: Intialize pointer passed to get_cmdvec
In reply to Christof SchmittFrom: Christof Schmitt <[email protected]>
get_cmdvec can return before the vector argument has been initialized. Fix this by initializing the pointer before passing it to get_cmdvec. This fixes a segfault in the interactive mode when hitting the tab key directly on the command prompt.
Signed-off-by Christof Schmitt <[email protected]>
--- multipathd/cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
multipathd/cli.c +2 -2
@@ -363,7 +363,7 @@ parse_cmd (char * cmd, char ** reply, in {int r;struct handler * h; -vector cmdvec; +vector cmdvec =NULL ; r =get_cmdvec (cmd, &cmdvec);
@@ -467,7 +467,7 @@ key_generator (const char * str, int stastruct key * kw;int i;struct handler *h; -vector v; +vector v =NULL ;if (!state) { index =0 ;