Commit d9be9b90 authored by Jan Beulich's avatar Jan Beulich Committed by Linus Torvalds

lib/vsprintf.c: fix interaction of kasprintf() and vsnprintf() when using %pV

Otherwise, the warning at the top of vsnprintf() gets triggered by
kvasprintf()'s first invocation (with NULL buffer and zero size) of
vsnprintf().
Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 746a2a83
...@@ -898,7 +898,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, ...@@ -898,7 +898,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
case 'U': case 'U':
return uuid_string(buf, end, ptr, spec, fmt); return uuid_string(buf, end, ptr, spec, fmt);
case 'V': case 'V':
return buf + vsnprintf(buf, end - buf, return buf + vsnprintf(buf, end > buf ? end - buf : 0,
((struct va_format *)ptr)->fmt, ((struct va_format *)ptr)->fmt,
*(((struct va_format *)ptr)->va)); *(((struct va_format *)ptr)->va));
case 'K': case 'K':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment