summaryrefslogtreecommitdiff
path: root/compat/regex/regex_internal.h
diff options
context:
space:
mode:
authorMarcel Röthke <marcel@roethke.info>2024-04-16 12:52:48 +0200
committerJunio C Hamano <gitster@pobox.com>2024-04-16 08:42:36 -0700
commit167395bb47d02a2acace0c979c6d4a3020b70c88 (patch)
tree5f9bad28661701bbd8ea1242fda2079d5e9cc41a /compat/regex/regex_internal.h
parent9bbde12feed306b9044060e4eab6b3b4c6628050 (diff)
rerere: fix crashes due to unmatched opening conflict markers
When rerere handles a conflict with an unmatched opening conflict marker in a file with other conflicts, it will fail create a preimage and also fail allocate the status member of struct rerere_dir. Currently the status member is allocated after the error handling. This will lead to a SEGFAULT when the status member is accessed during cleanup of the failed parse. Additionally, in subsequent executions of rerere, after removing the MERGE_RR.lock manually, rerere crashes for a similar reason. MERGE_RR points to a conflict id that has no preimage, therefore the status member is not allocated and a SEGFAULT happens when trying to check if a preimage exists. Solve this by making sure the status field is allocated correctly and add tests to prevent the bug from reoccurring. This does not fix the root cause, failing to parse stray conflict markers, but I don't think we can do much better than recognizing it, printing an error, and moving on gracefully. Signed-off-by: Marcel Röthke <marcel@roethke.info> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/regex/regex_internal.h')
0 files changed, 0 insertions, 0 deletions