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 fa94ed652d2ce87fddf824aa516456b5f42735e7..5033b049d995d95d9bee059f601223daf5271bfc 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;