[Bug 230720] strptime() conversion and validation issues

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Aug 17 22:19:09 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230720

            Bug ID: 230720
           Summary: strptime() conversion and validation issues
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: rlittle at inetco.com

Created attachment 196301
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=196301&action=edit
Patch file for strptime.c

I've been running the FreeBSD strptime() function through a few tests and a few
of things came up.

1) Some compile warnings were silenced by changing the type of len from int to
size_t. Also some compiler-reported possibly uninitialized use, which I don't
think are really bugs but best to be safe.

2) %k and %l should allow preceding blanks. The current version requires all
digits and throws an error. I have put in a little fix to permit this.

3) %I and %l should generate an error on 0. A small check added for that.

4) %d should generate an error on 0. A small check added for that.

Patch attached.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list