Subject: Re: [PATCH 1/3] pretty.c: fix null pointer dereference

From: Mirko Faina <[email-masked]>
Date: Tue, 24 Feb 2026 08:43:22 +0100

> void get_commit_format(const char *arg, struct rev_info *rev)
> {
> 	struct cmt_fmt_map *commit_format;
> 
> 	rev->use_terminator = 0;
> 	if (!arg) {
> 		rev->commit_format = CMIT_FMT_DEFAULT;
> 		return;
> 	}
> 	if (skip_prefix(arg, "format:", &arg)) {
> 		save_user_format(rev, arg, 0);
> 		return;
> 	}
> 
> 	if (!*arg || skip_prefix(arg, "tformat:", &arg) || strchr(arg, '%')) {

Seeing how "arg" is being handled here I am now unsure if it is actually
a bug.

CC'ing Jeff for clarifications

> 		save_user_format(rev, arg, 1);
> 		return;
> 	}