Home
last modified time | relevance | path

Searched hist:ef0658f3de484bf9b173639cd47544584e01efa5 (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/lib/
H A Dvsprintf.cdiff 4e310fda91cb095915395f811d10b2c900c9589e Wed Apr 14 11:27:40 CDT 2010 Joe Perches <joe@perches.com> vsprintf: Change struct printf_spec.precision from s8 to s16

Commit ef0658f3de484bf9b173639cd47544584e01efa5 changed precision
from int to s8.

There is existing kernel code that uses a larger precision.

An example from the audit code:
vsnprintf(...,..., " msg='%.1024s'", (char *)data);
which overflows precision and truncates to nothing.

Extending precision size fixes the audit system issue.

Other changes:

Change the size of the struct printf_spec.type from u16 to u8 so
sizeof(struct printf_spec) stays as small as possible.
Reorder the struct members so sizeof(struct printf_spec) remains 64 bits
without alignment holes.
Document the struct members a bit more.

Original-patch-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Joe Perches <joe@perches.com>
Tested-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff ef0658f3de484bf9b173639cd47544584e01efa5 Sat Mar 06 19:10:14 CST 2010 Joe Perches <joe@perches.com> vsprintf.c: Reduce sizeof struct printf_spec from 24 to 8 bytes

Reducing the size of struct printf_spec is a good thing because multiple
instances are commonly passed on stack.

It's possible for type to be u8 and field_width to be s8, but this is
likely small enough for now.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>