asn1/a_time.c: make handling of 'fractional point' formally correct.
authorAndy Polyakov <appro@openssl.org>
Mon, 31 Jul 2017 10:34:01 +0000 (12:34 +0200)
committerAndy Polyakov <appro@openssl.org>
Tue, 1 Aug 2017 20:39:27 +0000 (22:39 +0200)
commitb7e011f8b6cf0dc5078932ebc3c06196b37e2a4c
tree8b405237381ea7aaf036e6fda259ba0ba6d2f08e
parenta9dee230372d641a898ab475611d01dde4a6b525
asn1/a_time.c: make handling of 'fractional point' formally correct.

Even though tm->length >= 15 && v[14] == '.' works in practice,
[because "YYYYMMDDHHMMSS." would be rejected as invalid by
asn1_time_to_tm,] formal correctness with respect to buffer
overstep in few lines vicinity improves readability.

[Also fold one if condition and improve expression readability.]

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4058)
crypto/asn1/a_time.c