Re: [PATCH] refspec: initalize `refspec_item` in `valid_fetch_refspec()`

2018-06-05 Thread Brandon Williams
On 06/04, Ævar Arnfjörð Bjarmason wrote: > > On Mon, Jun 04 2018, Martin Ågren wrote: > > > We allocate a `struct refspec_item` on the stack without initializing > > it. In particular, its `dst` and `src` members will contain some random > > data from the stack. When we later call

Re: [PATCH] refspec: initalize `refspec_item` in `valid_fetch_refspec()`

2018-06-04 Thread Martin Ågren
On 4 June 2018 at 23:55, Ævar Arnfjörð Bjarmason wrote: > I think this makes more sense instead of this fix: [...] > -void refspec_item_init(struct refspec_item *item, const char *refspec, int > fetch) > +int refspec_item_init(struct refspec_item *item, const char *refspec, int > fetch) > { >

Re: [PATCH] refspec: initalize `refspec_item` in `valid_fetch_refspec()`

2018-06-04 Thread Ævar Arnfjörð Bjarmason
On Mon, Jun 04 2018, Martin Ågren wrote: > We allocate a `struct refspec_item` on the stack without initializing > it. In particular, its `dst` and `src` members will contain some random > data from the stack. When we later call `refspec_item_clear()`, it will > call `free()` on those pointers.

Re: [PATCH] refspec: initalize `refspec_item` in `valid_fetch_refspec()`

2018-06-04 Thread Brandon Williams
On 06/04, Martin Ågren wrote: > We allocate a `struct refspec_item` on the stack without initializing > it. In particular, its `dst` and `src` members will contain some random > data from the stack. When we later call `refspec_item_clear()`, it will > call `free()` on those pointers. So if the

[PATCH] refspec: initalize `refspec_item` in `valid_fetch_refspec()`

2018-06-04 Thread Martin Ågren
We allocate a `struct refspec_item` on the stack without initializing it. In particular, its `dst` and `src` members will contain some random data from the stack. When we later call `refspec_item_clear()`, it will call `free()` on those pointers. So if the call to `parse_refspec()` did not assign