Re: [PATCH 1/1] src: out of bounds problem in smsutil

2011-02-16 Thread Denis Kenzior
Hi Jessica, On 02/16/2011 06:04 AM, Jessica Nilsson wrote: --- This one was exposed when wgmodem2.5 CBS was run with valgrind. Best Regards, Jessica Nilsson Can you post the actual error and the data this happened on? src/smsutil.c |2 +- 1 files changed, 1 insertions(+), 1

Re: [PATCH 1/1] src: out of bounds problem in smsutil

2011-02-16 Thread Andreas WESTIN
On 2011-02-16 16:25, Denis Kenzior wrote: Hi Jessica, On 02/16/2011 06:04 AM, Jessica Nilsson wrote: --- This one was exposed when wgmodem2.5 CBS was run with valgrind. Best Regards, Jessica Nilsson Can you post the actual error and the data this happened on? src/smsutil.c |2 +-

Re: [PATCH 1/1] src: out of bounds problem in smsutil

2011-02-16 Thread Denis Kenzior
Hi Andreas, } /* Space for ranges, commas and terminator null */ -ret = g_new(char, len + nelem); +ret = g_new0(char, len + nelem + 1); I'm having trouble seeing how the old code was wrong. nelem contains the number of elements. Since the last element does not end

Re: [PATCH 1/1] src: out of bounds problem in smsutil

2011-02-16 Thread Andreas WESTIN
Hi, Valgrind complains that we step outside the allocated memory by 1 byte since we loop the string with: while (*topics != '\0') the allocated memory is the size of the string and any \0 ends up outside. At least that's my interpretation. It might be your loop is actually going past the