5e0ec9012b
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
|
||
---|---|---|
.. | ||
.cvsignore | ||
Makefile | ||
o_names.c | ||
obj_dat.c | ||
obj_dat.h | ||
obj_dat.pl | ||
obj_err.c | ||
obj_lib.c | ||
obj_mac.h | ||
obj_mac.num | ||
obj_xref.c | ||
obj_xref.h | ||
obj_xref.txt | ||
objects.h | ||
objects.pl | ||
objects.README | ||
objects.txt | ||
objxref.pl |