@@ -272,7 +272,9 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *statdie("Could not get fetch map for refspec %s",states->remote->fetch_refspec[i]);-states->new.strdup_strings=states->tracked.strdup_strings=1;+states->new.strdup_strings=+states->tracked.strdup_strings=+states->stale.strdup_strings=1;for(ref=fetch_map;ref;ref=ref->next){unsignedcharsha1[20];if(!ref->peer_ref||read_ref(ref->peer_ref->name,sha1))
On Tue, Dec 1, 2009 at 09:35, Johannes Schindelin
[off-list ref] wrote:
Hi,
On Tue, 1 Dec 2009, Bert Wesarg wrote:
quoted
Signed-off-by: Bert Wesarg <redacted>
Thanks. I trust you ran the test suite with valgrind just to make sure?
Not the test suite. But my use case where I found the problem (Ie.
cut-off branch names) which was 'git remote show <remote>'.
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.
Bert
On Tue, Dec 1, 2009 at 10:05, Bert Wesarg [off-list ref] wrote:
On Tue, Dec 1, 2009 at 09:35, Johannes Schindelin
quoted
Thanks. I trust you ran the test suite with valgrind just to make sure?
Not the test suite. But my use case where I found the problem (Ie.
cut-off branch names) which was 'git remote show <remote>'.
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.
I need this new suppression to run the test suite:
On Tue, Dec 1, 2009 at 10:05, Bert Wesarg [off-list ref] 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)