decompress_iob(): Fix detection of insufficient data
authorFabian Keil <fk@fabiankeil.de>
Thu, 28 Jan 2021 15:26:45 +0000 (16:26 +0100)
committerFabian Keil <fk@fabiankeil.de>
Sat, 30 Jan 2021 16:21:25 +0000 (17:21 +0100)
Instead of checking the size of the iob we have to
check the size of the actual data.

Previously Privoxy could try to work on uninitialized data.

parsers.c

index 14aa99e..3b19530 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -540,7 +540,7 @@ jb_err decompress_iob(struct client_state *csp)
 
    cur = csp->iob->cur;
 
 
    cur = csp->iob->cur;
 
-   if (bufsize < (size_t)10)
+   if (old_size < (size_t)10)
    {
       /*
        * This is to protect the parsing of gzipped data,
    {
       /*
        * This is to protect the parsing of gzipped data,