about summary refs log tree commit diff stats
path: root/shared.c
diff options
context:
space:
mode:
authorJason A. Donenfeld2014-02-20 19:48:24 +0100
committerJason A. Donenfeld2014-02-20 19:48:24 +0100
commit7e1c0ed2aa50ed2290f63912897a3724b224b7ea (patch)
tree26bd4b76373e658f86513b683f9ffe8d6482d4cc /shared.c
parentgen-version.sh: check if git is available before trying to call it (diff)
downloadcgit-7e1c0ed2aa50ed2290f63912897a3724b224b7ea.tar.gz
cgit-7e1c0ed2aa50ed2290f63912897a3724b224b7ea.zip
diffstat: do not rely on uninitialized data
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@zx2c4.com>
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c1
1 files changed, 1 insertions, 0 deletions
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,
368 struct diff_options opt; 368 struct diff_options opt;
369 struct pathspec_item item; 369 struct pathspec_item item;
370 370
371 memset(&item, 0, sizeof(item));
371 diff_setup(&opt); 372 diff_setup(&opt);
372 opt.output_format = DIFF_FORMAT_CALLBACK; 373 opt.output_format = DIFF_FORMAT_CALLBACK;
373 opt.detect_rename = 1; 374 opt.detect_rename = 1;