[Privoxy-commits] [privoxy] 05/26: chunked_body_is_complete(): Pass valid buffer length to parse_chunk_size()

User Git git at git.privoxy.org
Sat Oct 10 09:01:31 CEST 2026


This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository privoxy.

commit 5b06bd9062b002de4f8aca3ac712c3e42e76da23
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Sun Sep 20 10:43:18 2026 +0200

    chunked_body_is_complete(): Pass valid buffer length to parse_chunk_size()
    
    Previously an unitialized variable was passed which could result in
    "Conditional jump or move depends on uninitialised value(s)" warnings
    from valgrind.
    
    It remains unclear if the issue could also be used to cause reads
    of unitialized memory or trigger crashes with ASAN or USAN.
    
    OVE-20261004-0001.
---
 jcc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/jcc.c b/jcc.c
index 383eff55..9506047c 100644
--- a/jcc.c
+++ b/jcc.c
@@ -1516,15 +1516,17 @@ static enum chunk_status chunked_body_is_complete(struct iob *iob, size_t *lengt
 
    do
    {
+      size_t data_left = (size_t)(iob->eod - p);
       /*
        * We need at least a single digit, followed by "\r\n",
        * followed by an unknown amount of data, followed by "\r\n".
        */
-      if (p + 5 > iob->eod)
+      if (5 > data_left)
       {
          return CHUNK_STATUS_MISSING_DATA;
       }
-      if (JB_ERR_OK != parse_chunk_size(p, *length, &chunksize))
+
+      if (JB_ERR_OK != parse_chunk_size(p, data_left, &chunksize))
       {
          return CHUNK_STATUS_PARSE_ERROR;
       }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Privoxy-commits mailing list