strptime bugs

Thorsten Kukuk kukuk@suse.de
Sat Dec 15 10:50:00 GMT 2001


Hi,

According to the LSB test suite and the Austin Draft, our strptime
implementation has some bugs:

strptime("12", "%I", &testbuf) should return tm_hour = 12
The range is [1,12], not [0,11]. But we return tm_hour = 0.

strptime("0091 00 01", "%y %w %W", &testbuf) returns NULL.

strptime("0091", "%y", &testbuf) returns tm_year = 100, but this
should be tm_year = 91.

The leading zeros are allowed.

Adding this test case to our tst-strptime.c showed another bug:
We dereference the strptime result without checking, if NULL was
returned. So our test program seg.faults.

  Thorsten
-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE GmbH            Deutschherrenstr. 15-19       D-90429 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B



More information about the Libc-hacker mailing list