This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

strptime() could hangs for hours


Hi,
strptime() function could hangs if format string contains characters
which set date by week number (U,W,V).
Example:
struct tm tm;
tm.tm_year = 0x6FFFFFFF;
strptime("52", "%U", &tm);

This happens because first_day() function call hangs for hours if big
year value is passed to it.
We could not assume that tm_year field of tm structure has correct value
at processing U,V,W characters in strptime(), so first_day() function
parameter could have any value.
In BSD libc characters U,V and W are ignored (only range check is
performed).
Is this behaviour of strptime() in newlib correct?
-- 
Aleksandr Platonov


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]