mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 08:28:42 +00:00
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>
This commit is contained in:
parent
e8cacb5981
commit
7e1c0ed2aa
1
shared.c
1
shared.c
@ -368,6 +368,7 @@ void cgit_diff_tree(const unsigned char *old_sha1,
|
|||||||
struct diff_options opt;
|
struct diff_options opt;
|
||||||
struct pathspec_item item;
|
struct pathspec_item item;
|
||||||
|
|
||||||
|
memset(&item, 0, sizeof(item));
|
||||||
diff_setup(&opt);
|
diff_setup(&opt);
|
||||||
opt.output_format = DIFF_FORMAT_CALLBACK;
|
opt.output_format = DIFF_FORMAT_CALLBACK;
|
||||||
opt.detect_rename = 1;
|
opt.detect_rename = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user