asn1: fix use-after-free in asn1_write
authorJeff Layton <jlayton@samba.org>
Mon, 14 Oct 2013 01:26:55 +0000 (21:26 -0400)
committerVolker Lendecke <vl@samba.org>
Mon, 14 Oct 2013 14:54:34 +0000 (16:54 +0200)
commitfec84112f3f7bdca9088ed7cabfe827bb21b0118
tree7be92f6f55703383fafd255d721fbf41e26bf565
parent13a10d43141c29dad61868b451c0c1dca82360de
asn1: fix use-after-free in asn1_write

On talloc_realloc failure, asn1_write calls talloc_free on an asn1_data
pointer and then tries to immediately set the has_error flag on it.

Skip the free and just set the has_error flag.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct 14 16:54:35 CEST 2013 on sn-devel-104
lib/util/asn1.c