List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] diffstat: do not rely on uninitialized data
@ 2014-02-20 18:50 Jason
  2014-02-20 19:08 ` Jason
  0 siblings, 1 reply; 2+ messages in thread
From: Jason @ 2014-02-20 18:50 UTC (permalink / raw)


Right now if you visit:
<http://git.zx2c4.com/systemd/diff/src/udev/udev-builtin-input_id.c?id=bcfce235>
you'll see that if you reload the page a few times, a bunch of times the
diffstat comes out with no lines being shown or changed. I'm not
currently sure what the cause of this is, but I suspect it might have to
do with this uninitialized data.

Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
---
 shared.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/shared.c b/shared.c
index 7e88bbd..8ed14c0 100644
--- a/shared.c
+++ b/shared.c
@@ -368,6 +368,7 @@ void cgit_diff_tree(const unsigned char *old_sha1,
 	struct diff_options opt;
 	struct pathspec_item item;
 
+	memset(&item, 0, sizeof(item));
 	diff_setup(&opt);
 	opt.output_format = DIFF_FORMAT_CALLBACK;
 	opt.detect_rename = 1;
-- 
1.8.5.4



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] diffstat: do not rely on uninitialized data
  2014-02-20 18:50 [PATCH] diffstat: do not rely on uninitialized data Jason
@ 2014-02-20 19:08 ` Jason
  0 siblings, 0 replies; 2+ messages in thread
From: Jason @ 2014-02-20 19:08 UTC (permalink / raw)


Okay after applying the patch I no longer receive this bug, so
presumably this was the correct fix. Committed to master.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-20 19:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20 18:50 [PATCH] diffstat: do not rely on uninitialized data Jason
2014-02-20 19:08 ` Jason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).