# Null pointer dereference in error pathway on git pull

3 messages from 2021-01-26 to 2021-01-27. Participants: Joshua Hudson, Jeff King.
Thread: https://gitlist.dev/t/55056

## Joshua Hudson, 2021-01-26 20:31

Subject: Null pointer dereference in error pathway on git pull
Message-ID: <1cda3398-7b02-edc5-aaab-c75191124b80@cedaron.com>
URL: https://gitlist.dev/e/1cda3398-7b02-edc5-aaab-c75191124b80%40cedaron.com

```
>git pull
remote: Azure Repos
remote: Found 452 objects to send. (157 ms)
Rfatal: the remote end hung up unexpectedly
fatal: early EOFs:  81% (367/452)
fatal: index-pack failed
warning: unable to unlink '(NULL)': Invalid argument


So it hits some kind of error (looks like network disconnect) and tries
to back out; passed a NULL pointer to unlink().

Apologies if this has been submitted before. A search didn't find it.


```

## Joshua Hudson, 2021-01-26 23:01

Subject: Re: Null pointer dereference in error pathway on git pull
Message-ID: <f8b3b05a-db46-1977-6fb4-ed13ac48e131@cedaron.com>
URL: https://gitlist.dev/e/f8b3b05a-db46-1977-6fb4-ed13ac48e131%40cedaron.com
In-Reply-To: <YBCd2ZAumP65yrUK@coredump.intra.peff.net>

```
2.29.2; yeah it does look like it could be the same bug

On 1/26/2021 2:55 PM, Jeff King wrote:
> On Tue, Jan 26, 2021 at 12:31:30PM -0800, Joshua Hudson wrote:
>
>>> git pull
>> remote: Azure Repos
>> remote: Found 452 objects to send. (157 ms)
>> Rfatal: the remote end hung up unexpectedly
>> fatal: early EOFs:  81% (367/452)
>> fatal: index-pack failed
>> warning: unable to unlink '(NULL)': Invalid argument
>>
>>
>> So it hits some kind of error (looks like network disconnect) and tries
>> to back out; passed a NULL pointer to unlink().
>>
>> Apologies if this has been submitted before. A search didn't find it.
> Which version of Git are you using? It sounds like the same bug fixed by
> 6031af387e (fetch-pack: disregard invalid pack lockfiles, 2020-11-30).
> That's in v2.30.0.
>
> -Peff

```

## Jeff King, 2021-01-26 22:55

Subject: Re: Null pointer dereference in error pathway on git pull
Message-ID: <YBCd2ZAumP65yrUK@coredump.intra.peff.net>
URL: https://gitlist.dev/e/YBCd2ZAumP65yrUK%40coredump.intra.peff.net
In-Reply-To: <1cda3398-7b02-edc5-aaab-c75191124b80@cedaron.com>

```
On Tue, Jan 26, 2021 at 12:31:30PM -0800, Joshua Hudson wrote:

> >git pull
> remote: Azure Repos
> remote: Found 452 objects to send. (157 ms)
> Rfatal: the remote end hung up unexpectedly
> fatal: early EOFs:  81% (367/452)
> fatal: index-pack failed
> warning: unable to unlink '(NULL)': Invalid argument
> 
> 
> So it hits some kind of error (looks like network disconnect) and tries
> to back out; passed a NULL pointer to unlink().
> 
> Apologies if this has been submitted before. A search didn't find it.

Which version of Git are you using? It sounds like the same bug fixed by
6031af387e (fetch-pack: disregard invalid pack lockfiles, 2020-11-30).
That's in v2.30.0.

-Peff

```
