uclient-fetch: read_data_cb: fix a potential buffer overflow
[project/uclient.git] / uclient-fetch.c
index d9582f55e2c1d46b78886ba22d2244be523f4554..dff144b22b7b3cd2d5982a615b9c2d68deab5042 100644 (file)
@@ -262,7 +262,7 @@ static void read_data_cb(struct uclient *cl)
 
        while (1) {
                len = uclient_read(cl, buf, sizeof(buf));
-               if (!len)
+               if (len <= 0)
                        return;
 
                out_bytes += len;