FreeBSD Bugzilla – Attachment 131877 Details for
Bug 176053
[xen] [patch] i386: Correct wrong usage of vsnprintf()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
0001-i386-Correct-wrong-usage-of-vsnprintf.patch
0001-i386-Correct-wrong-usage-of-vsnprintf.patch (text/plain), 1.10 KB, created by
Christoph Mallon
on 2013-02-12 08:40:00 UTC
(
hide
)
Description:
0001-i386-Correct-wrong-usage-of-vsnprintf.patch
Filename:
MIME Type:
Creator:
Christoph Mallon
Created:
2013-02-12 08:40:00 UTC
Size:
1.10 KB
patch
obsolete
>From 1fdbba2f44e3e2782c044d5b6a91beb701d10072 Mon Sep 17 00:00:00 2001 >From: Christoph Mallon <christoph.mallon@gmx.de> >Date: Sat, 12 Jan 2013 09:36:40 +0100 >Subject: [PATCH] i386: Correct wrong usage of vsnprintf(). > >- vsnprintf() always NUL terminates the string. >- retval might be larger than the size of buf. >--- > sys/i386/xen/xen_machdep.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > >diff --git a/sys/i386/xen/xen_machdep.c b/sys/i386/xen/xen_machdep.c >index 3b3da6f..32352bc 100644 >--- a/sys/i386/xen/xen_machdep.c >+++ b/sys/i386/xen/xen_machdep.c >@@ -177,18 +177,17 @@ xen_boothowto(char *envp) > return howto; > } > >-#define PRINTK_BUFSIZE 1024 > void > printk(const char *fmt, ...) > { > __va_list ap; > int retval; >- static char buf[PRINTK_BUFSIZE]; >+ static char buf[1024]; > > va_start(ap, fmt); >- retval = vsnprintf(buf, PRINTK_BUFSIZE - 1, fmt, ap); >+ retval = vsnprintf(buf, sizeof(buf), fmt, ap); > va_end(ap); >- buf[retval] = 0; >+ retval = min(retval, (int)sizeof(buf) - 1); > (void)HYPERVISOR_console_write(buf, retval); > } > >-- >1.8.1.3
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 176053
: 131877