Skip to content

Commit

Permalink
fix: Fix heap use-after-free in ion extractor test
Browse files Browse the repository at this point in the history
  • Loading branch information
sadderchris authored and tgregg committed Feb 10, 2022
1 parent b676fcb commit a33386e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/test_ion_extractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,13 @@ TEST(IonExtractorSucceedsWhen, MultiplePathsCreatedUpFrontMatch) {
assertion_contexts[path2->_path_id].path = path2;
assertion_contexts[path3->_path_id].path = path3;

ION_EXTRACTOR_TEST_MATCH;
ION_ASSERT_OK(ion_test_new_text_reader(ion_text, &reader)); \
ION_ASSERT_OK(ion_extractor_match(extractor, reader)); \
ION_EXTRACTOR_TEST_ASSERT_MATCHED(path->_path_id, 1);
ION_EXTRACTOR_TEST_ASSERT_MATCHED(path2->_path_id, 1);
ION_EXTRACTOR_TEST_ASSERT_MATCHED(path3->_path_id, 1);
ION_ASSERT_OK(ion_extractor_close(extractor)); \
ION_ASSERT_OK(ion_reader_close(reader));

}

Expand Down

0 comments on commit a33386e

Please sign in to comment.