openssl/crypto/objects
Gunnar Kudrjavets 56d88027f0 Fix the heap corruption in libeay32!OBJ_add_object.
Original 'sizeof(ADDED_OBJ)' was replaced with 'sizeof(*ao)'. However,
they return different sizes. Therefore as the result heap gets corrupted
and at some point later debug version of malloc() detects the corruption.

On x86 we can observe that as follows:

sizeof(*ao) == 4
sizeof(*ao[0]) == sizeof(ADDED_OBJ) == 8

Issue reproduces with either enabling CRT debug heap or Application
Verifier's full-page heap.

Basic debugging data from the moment the corruption is first detected:

0:000:x86> |
.  0    id: 283c        create  name: openssl.exe
0:000:x86> kcn
 #
00 MSVCR120D!_heap_alloc_dbg_impl
01 MSVCR120D!_nh_malloc_dbg_impl
02 MSVCR120D!_nh_malloc_dbg
03 MSVCR120D!malloc
04 LIBEAY32!default_malloc_ex
05 LIBEAY32!CRYPTO_malloc
06 LIBEAY32!lh_insert
07 LIBEAY32!OBJ_add_object
08 LIBEAY32!OBJ_create
09 openssl!add_oid_section
0a openssl!req_main
0b openssl!do_cmd
0c openssl!main
0d openssl!__tmainCRTStartup
0e openssl!mainCRTStartup
0f KERNEL32!BaseThreadInitThunk
10 ntdll_77d60000!__RtlUserThreadStart
11 ntdll_77d60000!_RtlUserThreadStart

Signed-off-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-13 09:23:23 +01:00
..
Makefile Use safer sizeof variant in malloc 2015-05-04 15:00:13 -04:00
o_names.c Use safer sizeof variant in malloc 2015-05-04 15:00:13 -04:00
obj_dat.c Fix the heap corruption in libeay32!OBJ_add_object. 2015-05-13 09:23:23 +01:00
obj_dat.h make update 2015-05-05 21:49:51 +02:00
obj_dat.pl Fix OID encoding for one component. 2014-06-27 14:35:07 +01:00
obj_err.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
obj_lib.c free null cleanup finale 2015-05-01 10:02:07 -04:00
obj_mac.num Add more Camellia OIDs. 2015-02-11 20:28:47 +01:00
obj_xref.c Make sig_app, sigx_app static 2015-05-06 16:49:10 -04:00
obj_xref.h Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
obj_xref.txt Add new OIDs from RFC5753 2013-07-17 21:45:00 +01:00
objects.pl Bring objects.pl output even closer to new format. 2015-02-09 15:59:09 +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 ZLIB compression deserves a better comment 2015-05-06 02:07:58 +02:00
objxref.pl Make objxref.pl output in correct format 2015-02-04 03:50:09 +00:00