Re: [PATCH] get_oid: handle NULL repo->index

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

 



Jeff King <peff@xxxxxxxx> wrote:
> +++ b/sha1-name.c
> @@ -1837,7 +1837,7 @@ static enum get_oid_result get_oid_with_context_1(struct repository *repo,
>  		if (flags & GET_OID_RECORD_PATH)
>  			oc->path = xstrdup(cp);
>  
> -		if (!repo->index->cache)
> +		if (!repo->index || !repo->index->cache)
>  			repo_read_index(repo);

Awesome, looks obviously correct and can confirm it fixes the
new segfault :>

Now I'm kinda wondering if some static checker coulda/shoulda
spotted that, sooner.



[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