lkml.org 
[lkml]   [2010]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[REGRESSION PATCH] vsprintf: increase sizeof precision in printf_spec
Date
Patch ef0658f3de484bf9b173639cd47544584e01efa5 changed the precision field
from and int to an s8. Problem is that we have code which uses a much larger
precision in the kernel. An example would in the audit code where we have:

vsnprintf(...,..., " msg='%.1024s'", (char *)data);

which causes precision to be too large and end up truncating to nothing.
Raising the size of the precision fixes the audit system issue. It also does
not affect the alignment of the struct according to pahole and is still
approprietely packed.

Signed-off-by: Eric Paris <eparis@redhat.com>
---

lib/vsprintf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 24112e5..a957d3f 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -412,7 +412,7 @@ struct printf_spec {
s16 field_width; /* width of output field */
u8 flags; /* flags to number() */
u8 base;
- s8 precision; /* # of digits/chars */
+ s16 precision; /* # of digits/chars */
u8 qualifier;
};



\
 
 \ /
  Last update: 2010-04-14 03:17    [W:0.074 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site