Re: [PATCH v2 1/3] lib/vsprintf.c: Fix potential NULL deref in hex_string

2015-01-29 Thread Andy Shevchenko
On Thu, 2015-01-29 at 11:03 +0100, Rasmus Villemoes wrote: > The helper hex_string() is broken in two ways. First, it doesn't > increment buf regardless of whether there is room to print, so callers > such as kasprintf() that try to probe the correct storage to allocate > will get a too small retur

[PATCH v2 1/3] lib/vsprintf.c: Fix potential NULL deref in hex_string

2015-01-29 Thread Rasmus Villemoes
The helper hex_string() is broken in two ways. First, it doesn't increment buf regardless of whether there is room to print, so callers such as kasprintf() that try to probe the correct storage to allocate will get a too small return value. But even worse, kasprintf() (and likely anyone else trying