From: Jan Beulich Date: Wed, 25 May 2011 00:13:18 +0000 (-0700) Subject: lib/vsprintf.c: fix interaction of kasprintf() and vsnprintf() when using %pV X-Git-Tag: v3.0-rc1~191 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9be9b90d6dc5e712ca5d6109691a8de753ce7f1;p=platform%2Fkernel%2Flinux-exynos.git 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: Jan Beulich Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 1d659d7..c112056 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -898,7 +898,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, case 'U': return uuid_string(buf, end, ptr, spec, fmt); 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)->va)); case 'K':