From: Tim Kientzle Date: Sat, 16 May 2015 18:21:16 +0000 (-0700) Subject: Issue #540: Fix test to avoid use-after-free error. X-Git-Tag: v3.1.900a~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5bdfc30f155ae1d6cf0572dd8686966bbc0c69e;p=thirdparty%2Flibarchive.git Issue #540: Fix test to avoid use-after-free error. --- diff --git a/libarchive/test/test_archive_read_add_passphrase.c b/libarchive/test/test_archive_read_add_passphrase.c index 2811ab2f8..45f826d17 100644 --- a/libarchive/test/test_archive_read_add_passphrase.c +++ b/libarchive/test/test_archive_read_add_passphrase.c @@ -134,6 +134,7 @@ DEFINE_TEST(test_archive_read_add_passphrase_set_callback1) /* Without __archive_read_reset_passphrase call, the callback * should work fine. */ a = archive_read_new(); + ar = (struct archive_read *)a; assertEqualInt(ARCHIVE_OK, archive_read_set_passphrase_callback(a, NULL, callback1)); /* Fist call, we should get "passCallBack" as a passphrase. */