<div dir="ltr"><div>Applied.<br></div>Thanks.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 30, 2014 at 7:13 AM, Benjamin Marzinski <span dir="ltr"><<a href="mailto:bmarzins@redhat.com" target="_blank">bmarzins@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When multipath was mallocing the buffer in set_value, it was using<br>
sizeof(char *), instead of sizeof(char), so it was allocating a buffer<br>
big enough for an array of pointers instead of characters.<br>
<br>
Signed-off-by: Benjamin Marzinski <<a href="mailto:bmarzins@redhat.com">bmarzins@redhat.com</a>><br>
---<br>
 libmultipath/parser.c | 6 +++---<br>
 1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/libmultipath/parser.c b/libmultipath/parser.c<br>
index 526c45b..0d4c870 100644<br>
--- a/libmultipath/parser.c<br>
+++ b/libmultipath/parser.c<br>
@@ -408,11 +408,11 @@ set_value(vector strvec)<br>
                        len += strlen(str);<br>
                        if (!alloc)<br>
                                alloc =<br>
-                                   (char *) MALLOC(sizeof (char *) *<br>
+                                   (char *) MALLOC(sizeof (char) *<br>
                                                    (len + 1));<br>
                        else {<br>
                                alloc =<br>
-                                   REALLOC(alloc, sizeof (char *) * (len + 1));<br>
+                                   REALLOC(alloc, sizeof (char) * (len + 1));<br>
                                tmp = VECTOR_SLOT(strvec, i-1);<br>
                                if (alloc && *str != '"' && *tmp != '"')<br>
                                        strncat(alloc, " ", 1);<br>
@@ -422,7 +422,7 @@ set_value(vector strvec)<br>
                                strncat(alloc, str, strlen(str));<br>
                }<br>
        } else {<br>
-               alloc = MALLOC(sizeof (char *) * (size + 1));<br>
+               alloc = MALLOC(sizeof (char) * (size + 1));<br>
                if (alloc)<br>
                        memcpy(alloc, str, size);<br>
        }<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.1<br>
<br>
</font></span></blockquote></div><br></div>