]> git.ipfire.org Git - thirdparty/git.git/commit
negotiator/default: avoid stack overflow
authorHan Xin <hanxin.hx@bytedance.com>
Wed, 26 Apr 2023 13:15:03 +0000 (21:15 +0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Apr 2023 17:38:54 +0000 (10:38 -0700)
commit8e21ff5edb305bcfc12fc782f1c92542c427b624
treedce4a63684a16b580ae9eaaf62e01b8d254910c5
parent2807bd2c10606e590886543afe4e4f208dddd489
negotiator/default: avoid stack overflow

mark_common() in negotiator/default.c may overflow the stack due to
recursive function calls. Avoid this by instead recursing using a
heap-allocated data structure.

This is the same case as 4654134976f (negotiator/skipping: avoid
stack overflow, 2022-10-25)

Reported-by: Xin Xing <xingxin.xx@bytedance.com>
Signed-off-by: Han Xin <hanxin.hx@bytedance.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
negotiator/default.c