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

Re: [PATCH] Receive-pack: include entire SHA1 in nonce

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2014, 16:23 UTC
Message-ID
<xmqqoau3brf1.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1411657340-62950-1-git-send-email-brian@gernhardtsoftware.com>
Brian Gernhardt <brian@gernhardtsoftware.com> writes:
Show 14 quoted lines
> clang gives the following warning:
>
> builtin/receive-pack.c:327:35: error: sizeof on array function
> parameter will return size of 'unsigned char *' instead of 'unsigned
> char [20]' [-Werror,-Wsizeof-array-argument]
>         git_SHA1_Update(&ctx, out, sizeof(out));
>                                          ^
> builtin/receive-pack.c:292:37: note: declared here
> static void hmac_sha1(unsigned char out[20],
>                                     ^
> ---
>
>  I dislike changing sizeof to a magic constant, but clang informs me that
>  sizeof is doing the wrong thing.

Thanks. I knew the code was wrong when I wrote it but somehow it ended up as I wrote X-<. Let me find a brown paper bag ;-)

Previous: Brian GernhardtNext: Junio C Hamano
Message 2 of 5 in “Receive-pack: include entire SHA1 in nonce”
  1. Receive-pack: include entire SHA1 in nonceBrian Gernhardt, Sep 25, 2014
  2. Junio C HamanoSep 25, 2014
  3. Junio C HamanoSep 25, 2014
  4. Junio C HamanoSep 25, 2014
  5. Brian GernhardtSep 25, 2014

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.