Hanno Böck 5e0ec9012b Call of memcmp with null pointers in obj_cmp()
The function obj_cmp() (file crypto/objects/obj_dat.c) can in some
situations call memcmp() with a null pointer and a zero length.

This is invalid behaviour. When compiling openssl with undefined
behaviour sanitizer (add -fsanitize=undefined to compile flags) this
can be seen. One example that triggers this behaviour is the pkcs7
command (but there are others, e.g. I've seen it with the timestamp
function):
apps/openssl pkcs7 -in test/testp7.pem

What happens is that obj_cmp takes objects of the type ASN1_OBJECT and
passes their ->data pointer to memcmp. Zero-sized ASN1_OBJECT
structures can have a null pointer as data.

RT#3816

Signed-off-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit 2b8dc08b74fc3c6d4c2fc855cc23bac691d985be)
2015-05-13 15:32:23 +01:00
..
2015-03-13 21:14:56 -07:00
2015-04-18 14:44:17 +01:00
2015-01-22 09:38:39 +00:00
2015-04-16 13:51:51 -04:00
2015-04-16 13:51:51 -04:00
2015-04-16 13:51:51 -04:00
2015-04-16 13:51:51 -04:00
2015-04-16 13:51:51 -04:00
2015-04-30 23:27:07 +01:00
2015-03-25 12:45:17 +00:00
2015-04-16 13:51:51 -04:00
2015-04-16 13:51:51 -04:00
2015-03-25 15:19:20 +01:00
2012-06-08 09:18:47 +00:00
2015-04-16 13:51:51 -04:00
2015-04-30 23:27:07 +01:00
2015-04-16 13:51:51 -04:00
2015-03-19 13:38:37 +00:00
2015-04-16 13:51:51 -04:00
2015-01-22 09:38:39 +00:00
2011-08-12 12:31:08 +00:00
2015-02-09 13:01:28 +00:00
2015-04-22 17:24:47 +01:00
2015-01-22 09:38:39 +00:00
2015-01-22 09:38:39 +00:00
2015-01-22 09:38:39 +00:00
2015-01-22 09:38:39 +00:00
2015-03-19 13:41:07 +00:00
2015-01-22 09:38:39 +00:00