-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Getting panics at https://github.com/pbnjay/strptime/blob/master/strptime.go#L104 and https://github.com/pbnjay/strptime/blob/master/strptime.go#L111i when testing all kinds of bad format strings.
First panic slice bounds out of range happens when I test with format=invalid format with input of something like 12/12/17 -- or format strings with prefixes that are longer than the input strings. Should add some length checks of the input and format here before moving on. e.g. return error if len(ps) > len(value)
Second panic index out of range happens with format = %, %%, %%i etc. Probably just need to add a len check for ps before grabbing ps[0] and return an error if it's empty?
Metadata
Metadata
Assignees
Labels
No labels