openssl/crypto/objects
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 2b8dc08b74)
2015-05-13 15:32:23 +01:00
..
.cvsignore
Makefile make update 2014-01-06 13:33:27 +00:00
o_names.c Code style: space after 'if' 2015-04-16 13:51:51 -04:00
obj_dat.c Call of memcmp with null pointers in obj_cmp() 2015-05-13 15:32:23 +01:00
obj_dat.h make update 2014-08-06 22:18:45 +01:00
obj_dat.pl Fix OID encoding for one component. 2014-06-27 03:17:15 +01:00
obj_err.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
obj_lib.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
obj_mac.h Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
obj_mac.num incomplete provisional OAEP CMS decrypt support 2012-01-02 18:16:40 +00:00
obj_xref.c Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
obj_xref.h Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
obj_xref.txt Backport PSS signature support from HEAD. 2011-10-09 23:13:50 +00:00
objects.h Run util/openssl-format-source -v -c . 2015-01-22 09:38:39 +00:00
objects.pl Bring objects.pl output even closer to new format. 2015-02-09 16:02:44 +01:00
objects.README
objects.txt incomplete provisional OAEP CMS decrypt support 2012-01-02 18:16:40 +00:00
objxref.pl Make objxref.pl output in correct format 2015-02-04 13:35:49 +00:00