OSDN Git Service

rebase -i: set commit to null in exec commands
authorLiam Beguin <liambeguin@gmail.com>
Sun, 3 Dec 2017 22:17:15 +0000 (17:17 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Dec 2017 17:02:21 +0000 (09:02 -0800)
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>
sequencer.c

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