git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Fwd: New Defects reported by Coverity Scan for git

From
Stefan Beller <sbeller@google.com>
Date
Jul 18, 2017, 17:41 UTC
Message-ID
<CAGZ79kYohev8BdBEL9qnfmZ6quMwZPDRqZ44qCKV_wMwR=Etiw@mail.gmail.com>
In-Reply-To
<xmqqa841fylf.fsf@gitster.mtv.corp.google.com>
On Tue, Jul 18, 2017 at 10:23 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> I looked at this report for a while. My current understanding:
>> * its detection was triggered by including rs/move-array,
>>   f331ab9d4c (use MOVE_ARRAY, 2017-07-15)
>> * But it is harmless, because the scan logic does not understand
>>   how ALLOC_GROW works. It assumes that
>>   done_pbase_paths_alloc can be larger
>>   than done_pbase_paths_num + 1, while done_pbase_paths
>>   is NULL, such that the memory allocation is not triggered.
>>   If that were the case, then we have 2 subsequent dereferences
>>   of a NULL pointer right after that. But by inspecting the use
>>   of _alloc and _num the initial assumption does not seem possible.
>
> Yes, it does appear that way.  ALLOC_GROW() calls REALLOC_ARRAY()
> which safely can realloc NULL to specified size via xrealloc().
>
> I'd be more worried about segfault we seem to be getting only on
> Windows from this:
>
>     git -C parent grep -e "(1|2)d(3|4)" --recurse-submodules HEAD^ > actual
>
> in https://travis-ci.org/git/git/jobs/254654195 by the way.

Thanks for bringing that to my attention, (I do not follow the travis builds as closely, as there is no yelling email in my inbox).

Windows builds on travis seem to be flaky. (sometimes they do not start), but there are also successful builds, including the -rc0, which may indicate bw/grep-recurse-submodules may be faulty on Windows.

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 8 in “Fwd: New Defects reported by Coverity Scan for git”
  1. Stefan BellerJul 18, 2017
  2. Junio C HamanoJul 18, 2017
  3. Stefan BellerJul 18, 2017
  4. Junio C HamanoJul 18, 2017
  5. Brandon WilliamsJul 18, 2017
  6. Stefan BellerJul 18, 2017
  7. René ScharfeJul 20, 2017
  8. Junio C HamanoJul 20, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.