Summary: | [libc] strptime(3) succeeds on formats it should fail on | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | mickey242 | ||||||
Component: | kern | Assignee: | freebsd-standards (Nobody) <standards> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Only Me | CC: | ache, emaste, pfg | ||||||
Priority: | Normal | ||||||||
Version: | 6.0-RELEASE | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
mickey242
2006-02-11 20:00:20 UTC
Created attachment 147776 [details]
Possible fix
Suggested from ache@, while considering a different bug.
Assign to standards: this looks like a POSIX compliance issue. http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html ... RETURN VALUE Upon successful completion, strptime() shall return a pointer to the character following the last character parsed. Otherwise, a null pointer shall be returned. Created attachment 147941 [details]
Updated patch
Again from ache@ :
"... we need to return NULL on all currently unsupported formats, including mentioned ones and '\0'."
A commit references this bug: Author: ache Date: Tue Oct 7 06:34:05 UTC 2014 New revision: 272679 URL: https://svnweb.freebsd.org/changeset/base/272679 Log: 1) Fix the case we have less arguments for format string than we expected. 2) Return error on unsupported format specs. (both according to POSIX) PR: 93197 Changes: head/lib/libc/stdtime/strptime.c r272679 (along r272678) should be MFC'd since they are necessary for POSIX compliance. A commit references this bug: Author: ache Date: Sun Oct 19 21:16:25 UTC 2014 New revision: 273290 URL: https://svnweb.freebsd.org/changeset/base/273290 Log: MFC r272562,r272678,r272679 1) Fix the case we have less arguments for format string than we expected. 2) Return error on unsupported format specs. (both according to POSIX) 3) For %Z format, understand "UTC" name too. PR: 93197 Changes: _U stable/10/ stable/10/lib/libc/stdtime/strptime.c Committed into -stable A commit references this bug: Author: ache Date: Sun Sep 25 23:05:45 UTC 2016 New revision: 306326 URL: https://svnweb.freebsd.org/changeset/base/306326 Log: MFC r272562,r272678,r272679 1) Fix the case we have less arguments for format string than we expected. 2) Return error on unsupported format specs. (both according to POSIX) 3) For %Z format, understand "UTC" name too. PR: 93197 (only r272679) Changes: _U stable/9/ _U stable/9/lib/ _U stable/9/lib/libc/ _U stable/9/lib/libc/stdtime/ stable/9/lib/libc/stdtime/strptime.c |