]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
client: Fix return value check for sb_received().
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 9 Oct 2014 00:33:06 +0000 (00:33 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 18 Jan 2015 14:45:23 +0000 (15:45 +0100)
This bug can cause the client to segfault if it is fed invalid data.

client_common.c

index f615bb7289bd1951057a20743a21045019109a18..b47364c9bd7b91c09d2e0c28fedc69efd3e5c6d0 100644 (file)
@@ -159,7 +159,10 @@ again:
        }
        if (n == 0)
                return 0;
-       if (!sb_received(ct->sbc[0], n, result))
+       ret = sb_received(ct->sbc[0], n, result);
+       if (ret < 0)
+               return ret;
+       if (ret == 0)
                goto again;
        ct->sbc[0] = NULL;
        return 1;