]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix potential null-pointer dereference
authorSteffan Karger <steffan@karger.me>
Fri, 1 Apr 2016 16:43:00 +0000 (18:43 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 1 Apr 2016 18:35:14 +0000 (20:35 +0200)
commitb064b8111c718f3c4f996f256674ccd3ab62217f
tree78449a486a430d9cde30f596a017f1633c360460
parent2282b1be7968ef44accde705ccc64addab6d77ba
Fix potential null-pointer dereference

Commit a070f75b (master branch only) changed the openvpn_encrypt logic and
now prepends the contents of the work buffer to buf if no encryption is
used (which is the case for tls-auth packets).  In that case, the code
would potentially dereference a null-pointer in a memcpy(some-dest, 0, 0)
call.  Fortunately, memcpy() inplementations usually do not actually
derefence the src (or dst) pointer for zero-length copies.

And since I'm touching this code now anyway, remove a slightly confusing
jump back to a cleanup label in openvpn_encrypt_aead().

Issue spotted by Daniel Hirche.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1459528980-8304-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11372
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/crypto.c