Jeff King writes:
>> Answer. There is a single hit inside fsck.c that wants to report
>> an error without killing ourselves in fsck_commit_buffer(). I
>> however doubt its use of get_commit_tree() is correct in the
>> first place. The function is about validating the commit obje
On Fri, Sep 06, 2019 at 12:51:56PM -0400, Derrick Stolee wrote:
> > This one in theory benefits lots of other callsites, too, since it means
> > we'll actually return NULL instead of nonsense like "8". But grepping
> > around for calls to this function, I found literally zero of them
> > actually
On Fri, Sep 06, 2019 at 11:42:14AM -0400, Taylor Blau wrote:
> > > struct object_id *get_commit_tree_oid(const struct commit *commit)
> > > {
> > > - return &get_commit_tree(commit)->object.oid;
> > > + struct tree *tree = get_commit_tree(commit);
> > > + return tree ? &tree->object.oid : NULL;
On Fri, Sep 06, 2019 at 10:11:09AM -0700, Junio C Hamano wrote:
> > Is there even a single caller that is prepared to react to NULL?
> >
> > Answer. There is a single hit inside fsck.c that wants to report
> > an error without killing ourselves in fsck_commit_buffer(). I
> > however d
On Fri, Sep 06, 2019 at 09:57:29AM -0700, Junio C Hamano wrote:
> Jeff King writes:
>
> > This is sort-of attributable to my 834876630b (get_commit_tree(): return
> > NULL for broken tree, 2019-04-09). Before then it was a BUG(). However,
> > that state was relatively short-lived. Before 7b8a21d
Junio C Hamano writes:
> ...
> Is there even a single caller that is prepared to react to NULL?
>
> Answer. There is a single hit inside fsck.c that wants to report
> an error without killing ourselves in fsck_commit_buffer(). I
> however doubt its use of get_commit_tree() is correct
Jeff King writes:
> This is sort-of attributable to my 834876630b (get_commit_tree(): return
> NULL for broken tree, 2019-04-09). Before then it was a BUG(). However,
> that state was relatively short-lived. Before 7b8a21dba1 (commit-graph:
> lazy-load trees for commits, 2018-04-06), we'd have si
On 9/6/2019 2:19 AM, Jeff King wrote:
> On Thu, Sep 05, 2019 at 06:04:57PM -0400, Taylor Blau wrote:
>
>> @@ -846,7 +847,11 @@ static void write_graph_chunk_data(struct hashfile *f,
>> int hash_len,
>> if (parse_commit_no_graph(*list))
>> die(_("unable to parse c
On Fri, Sep 06, 2019 at 02:19:20AM -0400, Jeff King wrote:
> On Thu, Sep 05, 2019 at 06:04:57PM -0400, Taylor Blau wrote:
>
> > @@ -846,7 +847,11 @@ static void write_graph_chunk_data(struct hashfile *f,
> > int hash_len,
> > if (parse_commit_no_graph(*list))
> > di
On Thu, Sep 05, 2019 at 06:04:57PM -0400, Taylor Blau wrote:
> @@ -846,7 +847,11 @@ static void write_graph_chunk_data(struct hashfile *f,
> int hash_len,
> if (parse_commit_no_graph(*list))
> die(_("unable to parse commit %s"),
>
Apply similar treatment as in the previous commit to handle an unchecked
call to 'get_commit_tree_oid()'. Previously, a NULL return value from
this function would be immediately dereferenced with '->hash', and then
cause a segfault.
Before dereferencing to access the 'hash' member, check the retur
11 matches
Mail list logo