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

Re: [PATCH] get_ref_states: strdup entries and free util in stale list

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Dec 1, 2009, 18:20 UTC
Message-ID
<36ca99e90912011020u4bcc8802qd12049969d162c97@mail.gmail.com>
In-Reply-To
<36ca99e90912010105r428a7bfdw63928e8a5515bd1d@mail.gmail.com>
On Tue, Dec 1, 2009 at 10:05, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> There are still invalid reads of size 4. I think the problem is the
> flex array member of 'struct ref' and strlen(). If its worth I can
> look into this.
A short heads-up, here is the valgrind error I get for this invalid read:

==27305== Invalid read of size 4 ==27305== at 0x4936AF: copy_ref (remote.c:870) ==27305== by 0x4942E4: get_fetch_map (remote.c:1271) ==27305== by 0x44473E: get_remote_ref_states (builtin-remote.c:271) ==27305== by 0x446DCE: cmd_remote (builtin-remote.c:1022) ==27305== by 0x4045F0: handle_internal_command (git.c:257) ==27305== by 0x404B8F: main (git.c:482) ==27305== Address 0x5b5ba38 is 104 bytes inside a block of size 107 alloc'd ==27305== at 0x4C24477: calloc (vg_replace_malloc.c:418) ==27305== by 0x4B09AD: xcalloc (wrapper.c:75) ==27305== by 0x493924: alloc_ref_with_prefix (remote.c:853) ==27305== by 0x46653B: get_remote_heads (connect.c:96) ==27305== by 0x4A9347: get_refs_via_connect (transport.c:453) ==27305== by 0x4A7F14: transport_get_remote_refs (transport.c:895) ==27305== by 0x4445B6: get_remote_ref_states (builtin-remote.c:810) ==27305== by 0x446DCE: cmd_remote (builtin-remote.c:1022) ==27305== by 0x4045F0: handle_internal_command (git.c:257) ==27305== by 0x404B8F: main (git.c:482)

Previous: Bert Wesarg
Message 12 of 12 in “get_ref_states: strdup entries and free util in stale list”
  1. get_ref_states: strdup entries and free util in stale listBert Wesarg, Nov 30, 2009
  2. Junio C HamanoDec 1, 2009
  3. Bert WesargDec 1, 2009
  4. Junio C HamanoDec 1, 2009
  5. Bert WesargDec 1, 2009
  6. Junio C HamanoDec 1, 2009
  7. Bert WesargDec 1, 2009
  8. Junio C HamanoDec 1, 2009
  9. Johannes SchindelinDec 1, 2009
  10. Bert WesargDec 1, 2009
  11. Bert WesargDec 1, 2009
  12. Bert WesargDec 1, 2009

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.