Memory bounds checking in asn1 code.
authorPauli <paul.dale@oracle.com>
Thu, 6 Jul 2017 01:39:03 +0000 (11:39 +1000)
committerPauli <paul.dale@oracle.com>
Thu, 6 Jul 2017 02:59:51 +0000 (12:59 +1000)
commit60eba30f60de55e3c782469fa555eede82606099
tree682efcc6cc77d5759c2ffa2d61897ccb28ee5018
parenteee9552212ecc9e19bc09ea8a1b8428dc7394f45
Memory bounds checking in asn1 code.

Check that sprint, strcpy don't overflow.

Avoid some strlen operations when the previous sprintf return value can be used.

Also fix the undefined behaviour `*(long *)x = y` when x isn't a long or character pointer.
ISO/IEC 9899:1999 6.5/7 for the details.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3869)
crypto/asn1/a_gentm.c
crypto/asn1/a_mbstr.c
crypto/asn1/a_time.c
crypto/asn1/a_utctm.c
crypto/asn1/asn1_par.c
crypto/asn1/x_long.c