rebase -i: set commit to null in exec commands

Make sure commit is set to NULL when parsing exec instructions
from the todo list. If not, we may try to access an uninitialized
address later while updating the todo list.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Liam Beguin 2017-12-03 17:17:15 -05:00 committed by Junio C Hamano
parent f3b633dad4
commit 7dcbb3cb6d

View File

@ -1268,6 +1268,7 @@ static int parse_insn_line(struct todo_item *item, const char *bol, char *eol)
bol += padding; bol += padding;
if (item->command == TODO_EXEC) { if (item->command == TODO_EXEC) {
item->commit = NULL;
item->arg = bol; item->arg = bol;
item->arg_len = (int)(eol - bol); item->arg_len = (int)(eol - bol);
return 0; return 0;