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

Re: [PATCH] apply: use strcmp(3) for comparing strings in gitdiff_verify_name()

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Jul 8, 2017, 13:38 UTC
Message-ID
<87o9svgia8.fsf@linux-m68k.org>
In-Reply-To
<e46a7de9-3e0e-4eeb-c9a3-a8b5f22620b4@web.de>
On Jul 08 2017, René Scharfe <l.s.r@web.de> wrote:
Show 11 quoted lines
> Am 08.07.2017 um 13:08 schrieb Andreas Schwab:
>> On Jul 08 2017, René Scharfe <l.s.r@web.de> wrote:
>>
>>> Avoid running over the end of another -- a C string whose length we
>>> don't know -- by using strcmp(3) instead of memcmp(3) for comparing it
>>> with another C string.
>>
>> That's not a good justification for the change, since memcmp never reads
>> past the differing characters.
>
> Interesting.  Where does that guarantee come from?
Sorry, I misremembered.  It's only memchr that has this restriction.
Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Previous: René ScharfeNext: René Scharfe
Message 4 of 12 in “apply: use strcmp(3) for comparing strings in gitdiff_verify_name()”
  1. apply: use strcmp(3) for comparing strings in gitdiff_verify_name()René Scharfe, Jul 8, 2017
  2. Andreas SchwabJul 8, 2017
  3. René ScharfeJul 8, 2017
  4. Andreas SchwabJul 8, 2017
  5. René ScharfeJul 9, 2017
  6. Andreas SchwabJul 9, 2017
  7. René ScharfeJul 9, 2017
  8. Junio C HamanoJul 9, 2017
  9. Ramsay JonesJul 8, 2017
  10. René ScharfeJul 8, 2017
  11. Junio C HamanoJul 8, 2017
  12. René ScharfeJul 9, 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.