From 96ca358669cd32d17ce51f30de3cdbf0a1c0518c Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 20 Jan 2014 12:06:35 +0100 Subject: quic: Fix test which is always true find_model_params() is first doing *nbuckets = 0; and it then checks nbuckets for NULL. This is redundant as the dereferencing would cause a segfault if nbuckets was NULL, so the if (nbuckets) test can't be false. As Uri pointed out, the "/* bucket start */" comment on the same line probably implies that the test was meant to be 'if (*nbuckets)' I've ran a few test and I did not observe issues because of it... --- common/quic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/quic.c b/common/quic.c index 2cffde5..c10e3c4 100644 --- a/common/quic.c +++ b/common/quic.c @@ -954,7 +954,7 @@ static void find_model_params(Encoder *encoder, bsize = *firstsize; do { /* other buckets */ - if (nbuckets) { /* bucket start */ + if (*nbuckets) { /* bucket start */ bstart = bend + 1; } else { bstart = 0; -- cgit v1.2.3