mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Check for EOF to fix a segfault while parsing fuzzed MPC files.
This commit is contained in:
1
tests/data/segfault2.mpc
Normal file
1
tests/data/segfault2.mpc
Normal file
@ -0,0 +1 @@
|
||||
MPCKSH
|
@ -20,6 +20,7 @@ class TestMPC : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testFuzzedFile1);
|
||||
CPPUNIT_TEST(testFuzzedFile2);
|
||||
CPPUNIT_TEST(testFuzzedFile3);
|
||||
CPPUNIT_TEST(testFuzzedFile4);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -82,6 +83,12 @@ public:
|
||||
CPPUNIT_ASSERT(f.isValid());
|
||||
}
|
||||
|
||||
void testFuzzedFile4()
|
||||
{
|
||||
MPC::File f(TEST_FILE_PATH_C("segfault2.mpc"));
|
||||
CPPUNIT_ASSERT(f.isValid());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestMPC);
|
||||
|
Reference in New Issue
Block a user