]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix potential NULL ptr crash if compiled with DMALLOC
authorGert Doering <gert@greenie.muc.de>
Fri, 2 Apr 2021 17:34:14 +0000 (19:34 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 4 Apr 2021 08:57:20 +0000 (10:57 +0200)
commitacf52dda9f4cb117e9d020dd06fccd7ecb90d303
tree91dc3be5caf8110abb89c97d7d3339cc3df934a8
parenta31c4b73f56e1dddda64ba15b27f0c5b2c6a26d4
Fix potential NULL ptr crash if compiled with DMALLOC

In the unlikely case that we are compiled with -DDMALLOC *and*
malloc() returns NULL, there is an uncaught memset() which would
crash then.  Remove the memset(), as the right the next operation
after check_malloc_return() is a mempcy() which will overwrite
the whole memory block anyway.

Trac: #586

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20210402173414.14216-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21981.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit e2acfad40c0d79ce7fd431c380d7466d383bcefa)
src/openvpn/buffer.c