]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Issue #540: Fix test to avoid use-after-free error.
authorTim Kientzle <kientzle@acm.org>
Sat, 16 May 2015 18:21:16 +0000 (11:21 -0700)
committerTim Kientzle <kientzle@acm.org>
Sat, 16 May 2015 18:21:16 +0000 (11:21 -0700)
libarchive/test/test_archive_read_add_passphrase.c

index 2811ab2f8d8ae3e1e206f91ef1db17c1843e3b2c..45f826d17707b6059bfc9d110711dcd4cea6feb6 100644 (file)
@@ -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. */