Re: [PATCH] http-push: fix off-by-path_len
- From
Mike Hommey <mh@glandium.org>
- Date
- Jan 18, 2009, 07:49 UTC
- Message-ID
- <20090118074911.GB30228@glandium.org>
- In-Reply-To
- <alpine.DEB.1.00.0901171632330.3586@pacific.mpi-cbg.de>
On Sat, Jan 17, 2009 at 04:36:26PM +0100, Johannes Schindelin wrote:
Show 17 quoted lines
> > When getting the result of remote_ls(), we were advancing the variable > "path" to the relative path inside the repository. > > However, then we went on to malloc a bogus amount of memory: we were > subtracting the prefix length _again_, quite possibly getting something > negative, which xmalloc() interprets as really, really much. > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > --- > > Note that the push in t5540 is still broken, as http-push does > not handle packed-refs (when looking what branches are on the > remote side). > > It should not even try to access the directory structure under > refs/ to begin with, but read info/refs instead.
It would actually need to do both, because nothing guarantees info/refs is up-to-date.
> However, that is just one example of the ugliness that is > http-push.c; it also seems to be a perfect example of a copy-pasting > hell; just look at the output of "git grep > curl_easy_setopt http-push.c".
Likewise for http.c.
> There _has_ to be lot of room for improvement.
And I realize I have had a partial improvement on that sitting on my harddrive, without me having time (nor motivation) to go further.
Maybe it's time I let it go and post the work in progress for someone else to take over.
Mike