Re: [PATCH v2 15/18] test-reach: test commit_contains

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Tan <jonathantanmy@xxxxxxxxxx> writes:

>> +	} else if (!strcmp(av[1], "commit_contains")) {
>> +		struct ref_filter filter;
>> +		struct contains_cache cache;
>> +		init_contains_cache(&cache);
>> +
>> +		if (ac > 2 && !strcmp(av[2], "--tag"))
>> +			filter.with_commit_tag_algo = 1;
>> +		else
>> +			filter.with_commit_tag_algo = 0;
>> +
>> +		printf("%s(_,A,X,_):%d\n", av[1], commit_contains(&filter, A, X, &cache));
>
> Should we initialize filter (with {NULL} or some equivalent)?

Sounds like a sensible suggestion.  Wouldn't we segfault otherwise
depending on what garbage bytes are on the stack?



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux