public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [REGRESSION PATCH] vsprintf: increase sizeof precision in printf_spec
@ 2010-04-14  1:13 Eric Paris
  2010-04-14  1:33 ` Joe Perches
  2010-04-14 16:27 ` [REGRESSION PATCH V2] vsprintf: Change struct printf_spec.precision from s8 to s16 Joe Perches
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Paris @ 2010-04-14  1:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: joe, fweisbec

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;
 };
 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-14 18:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-14  1:13 [REGRESSION PATCH] vsprintf: increase sizeof precision in printf_spec Eric Paris
2010-04-14  1:33 ` Joe Perches
2010-04-14  2:44   ` Eric Paris
2010-04-14  3:01     ` Joe Perches
2010-04-14 14:40       ` Justin P. mattock
2010-04-14 15:00       ` Frederic Weisbecker
2010-04-14 16:27 ` [REGRESSION PATCH V2] vsprintf: Change struct printf_spec.precision from s8 to s16 Joe Perches
2010-04-14 16:47   ` Justin P. mattock
2010-04-14 18:50   ` Eric Paris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox