openssl/crypto/objects
Hanno Böck eba8bf485a 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 2b8dc08b74)
2015-05-13 15:28:48 +01:00
..
.cvsignore
Makefile
o_names.c Code style: space after 'if' 2015-04-16 13:50:01 -04:00
obj_dat.c Call of memcmp with null pointers in obj_cmp() 2015-05-13 15:28:48 +01:00
obj_dat.h Rebuild OID table. 2014-06-27 16:58:41 +01:00
obj_dat.pl Fix OID encoding for one component. 2014-06-27 16:58:16 +01:00
obj_err.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
obj_lib.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
obj_mac.h Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
obj_mac.num CABForum EV OIDs for Subject Jurisdiction of Incorporation or Registration. 2014-02-26 15:33:10 +00:00
obj_xref.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
obj_xref.h objects/obj_xref.h: revert reformat. 2015-02-10 08:55:30 +01:00
obj_xref.txt Add new OIDs from RFC5753 2013-10-01 14:01:17 +01:00
objects.h Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
objects.pl Bring objects.pl output even closer to new format. 2015-02-09 16:00:25 +01:00
objects.README
objects.txt CABForum EV OIDs for Subject Jurisdiction of Incorporation or Registration. 2014-02-26 15:33:10 +00:00
objxref.pl Make objxref.pl output in correct format 2015-02-04 13:35:35 +00:00