diff --git a/infra/cifuzz/sarif_utils.py b/infra/cifuzz/sarif_utils.py index 6bf2dd7e2da1..3cfd7cc4dac9 100644 --- a/infra/cifuzz/sarif_utils.py +++ b/infra/cifuzz/sarif_utils.py @@ -163,7 +163,8 @@ def get_error_frame(crash_info): return None state = crash_info.crash_state.split('\n')[0] logging.info('state: %s frames %s, %s', state, crash_info.frames, - [f.function_name for f in crash_info.frames[0]]) + [f.function_name for f in crash_info.frames[0]] + if crash_info.frames else []) for crash_frames in crash_info.frames: for frame in crash_frames: diff --git a/infra/cifuzz/sarif_utils_test.py b/infra/cifuzz/sarif_utils_test.py index e8870887c071..44481b569a78 100644 --- a/infra/cifuzz/sarif_utils_test.py +++ b/infra/cifuzz/sarif_utils_test.py @@ -105,6 +105,17 @@ def _get_mock_crash_info(): return crash_info +class GetErrorFrameTest(unittest.TestCase): + """Tests for get_error_frame.""" + + def test_empty_frames_does_not_raise(self): + """Tests that get_error_frame doesn't raise IndexError when frames is empty.""" + crash_info = mock.MagicMock() + crash_info.frames = [] + crash_info.crash_state = 'some_func\nsome_func1' + self.assertIsNone(sarif_utils.get_error_frame(crash_info)) + + class GetErrorSourceInfoTest(unittest.TestCase): """Tests for get_error_source_info.""" diff --git a/projects/php/project.yaml b/projects/php/project.yaml index ac74fe5ec52f..823558d21d70 100644 --- a/projects/php/project.yaml +++ b/projects/php/project.yaml @@ -7,6 +7,7 @@ auto_ccs: - "dmitrystogov@gmail.com" - "tovilo.ilija@gmail.com" - "github@derickrethans.nl" + - "jakub.php@gmail.com" fuzzing_engines: - "afl" - "honggfuzz"