From mboxrd@z Thu Jan 1 00:00:00 1970 From: list at eworm.de (Christian Hesse) Date: Mon, 10 Oct 2016 16:00:22 +0200 Subject: [PATCH 1/1] ui-log: fix data corruption In-Reply-To: <20161009112602.GN1997@john.keeping.me.uk> References: <20161007133526.2931-1-list@eworm.de> <20161007232123.5d7e8789@leda.localdomain> <20161009112602.GN1997@john.keeping.me.uk> Message-ID: <20161010160022.77e9feac@leda.localdomain> John Keeping on Sun, 2016/10/09 12:26: > On Fri, Oct 07, 2016 at 11:21:23PM +0200, Christian Hesse wrote: > > "Jason A. Donenfeld" on Fri, 2016/10/07 21:43: > > > Does this ever get freed, though? > > > > I ran cgit in valgrind with this patch applied. No changes in what is > > lost - so looks like this is freed later on. > > It isn't lost because there's a global reference to it via the commit > cache, but valgrind's "still reachable" statistic definitely grows as a > result of this patch. Ups, missed that. > I don't think this is the cause of the underlying problem Sylvain > reported. That's more likely to be the use of > get_cached_commit_buffer() in cgit_parse_commit(). Shouldn't that be > get_commit_buffer(), which uses the cached buffer if it's available? I have to admit that I am not very familiar with the caching system. :-p Just replacing that function has the desired effect, though. Calling cgit_print_branches() after cgit_print_log() works without crash. -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Best regards my address: */=0;b=c[a++];) putchar(b-1/(/* Chris cc -ox -xc - && ./x */b/42*2-3)*42);} -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 455 bytes Desc: OpenPGP digital signature URL: