n_str_dup(): don't assume NUL terminated source (Ralph Corderoy)..
commit536d3a78cebd857fc0d9499ab8ea9b5acb2165e4
authorSteffen (Daode) Nurpmeso <steffen@sdaoden.eu>
Fri, 25 Mar 2016 15:41:55 +0000 (25 16:41 +0100)
committerSteffen (Daode) Nurpmeso <steffen@sdaoden.eu>
Fri, 25 Mar 2016 15:47:53 +0000 (25 16:47 +0100)
treeb348195d388de1086960311736bf61648681b0a1
parent4e61d5c7417e6fe124e74d2ba0156f595de851f3
n_str_dup(): don't assume NUL terminated source (Ralph Corderoy)..

Ralph reported a bound violation on the ML and pointed to
valgrind for detection purposes.  It turns out n_str_dup()
simply assumed a properly NUL terminated source string, but
that may not be true when we init struct str with a buffer,
instead the .l length field of the string is the thing to
look at, the terminator must be added in addition.
strings.c