Bug 2509 - glibc printf length modifier (h) bug when using integer conversion (i)
Summary: glibc printf length modifier (h) bug when using integer conversion (i)
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-04 04:32 UTC by Mike Frysinger
Modified: 2018-04-19 15:12 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
glibc-test-integer-length-conversion.patch (428 bytes, patch)
2006-04-04 04:33 UTC, Mike Frysinger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Frysinger 2006-04-04 04:32:45 UTC
as a user pointed out in a Gentoo bug, the statement:
printf("%hi", 0xffff0010);
yields -65520 instead of the expected truncated value 16

oddly enough, printf("%hu", 0xffff0010); works as expected

tested Gentoo/glibc-2.4/amd64
Comment 1 Mike Frysinger 2006-04-04 04:33:31 UTC
Created attachment 950 [details]
glibc-test-integer-length-conversion.patch

updates the stdio printf tests to test for %hhi and %hi
Comment 2 Ulrich Drepper 2006-05-02 20:26:02 UTC
I checked in a patch.