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 Add emacs cache files to .cvsignore. 2005-04-11 14:17:07 +00:00
Makefile Add error checking to obj_xref.pl and add command line support for data 2009-02-10 13:03:31 +00:00
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 I got sick and tired of having to keep track of NIDs when such a thing 2000-07-05 02:45:36 +00:00
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