[Spice-commits] common/quic.c

Christophe Fergau teuf at kemper.freedesktop.org
Mon Jan 20 05:35:24 PST 2014


 common/quic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 96ca358669cd32d17ce51f30de3cdbf0a1c0518c
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Mon Jan 20 12:06:35 2014 +0100

    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...

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;


More information about the Spice-commits mailing list