Re: [PATCH v5 3/6] set-head: better output for --auto

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Bence Ferdinandy <bence@xxxxxxxxxxxxxx> writes:
>
>> +static void report_auto(const char *remote, const char *head_name,
>> +			struct strbuf *buf_prev) {
>> +	struct strbuf buf_prefix = STRBUF_INIT;
>> +	const char *prev_head;
>
> I think we need to initialize prev_head to NULL.
>
>> +	strbuf_addf(&buf_prefix, "refs/remotes/%s/", remote);
>> +	skip_prefix(buf_prev->buf, buf_prefix.buf, &prev_head);
>
> If the symref was not pointing into the "refs/remotes/<remote>/"
> hierarchy previously, skip_prefix() comes back without touching
> prev_head (i.e. not starting with the prefix does not clear it).

The two uninitialized prev_head were also noticed by compilers in
multiple jobs at GitHub CI.

https://github.com/git/git/actions/runs/11265515664






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux