gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] branch master updated (3ab54c6b -> ef15b53c


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (3ab54c6b -> ef15b53c)
Date: Mon, 15 Apr 2019 00:32:56 +0200

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

grothoff pushed a change to branch master
in repository libmicrohttpd.

    from 3ab54c6b Narrow scope of variable to succeed scan-build
     new 47a862a9 make Tim happy
     new ef15b53c Fix realloc memleak in compress_buf()

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/examples/http_chunked_compression.c | 12 +++++++++---
 src/microhttpd/digestauth.c             |  1 +
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/examples/http_chunked_compression.c 
b/src/examples/http_chunked_compression.c
index 36b3e1fd..9e49c131 100644
--- a/src/examples/http_chunked_compression.c
+++ b/src/examples/http_chunked_compression.c
@@ -41,6 +41,7 @@ compress_buf (z_stream *strm, const void *src, size_t 
src_size, size_t *offset,
   unsigned int have;
   int ret;
   int flush;
+  void *tmp_dest;
   *dest = NULL;
   *dest_size = 0;
   do
@@ -65,9 +66,14 @@ compress_buf (z_stream *strm, const void *src, size_t 
src_size, size_t *offset,
           ret = deflate (strm, flush);
           have = CHUNK - strm->avail_out;
           *dest_size += have;
-          *dest = realloc (*dest, *dest_size);
-          if (NULL == *dest)
-            return MHD_NO;
+          tmp_dest = realloc (*dest, *dest_size);
+          if (NULL == tmp_dest)
+            {
+              free (*dest);
+              *dest = NULL;
+              return MHD_NO;
+            }
+          *dest = tmp_dest;
           memcpy ((*dest) + ((*dest_size) - have), tmp, have);
         }
       while (0 == strm->avail_out);
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index 8f04bf38..0cd0219f 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -1057,6 +1057,7 @@ digest_auth_check_all (struct MHD_Connection *connection,
     else
       {
         /* This will initialize da->sessionkey (ha1) */
+        mhd_assert (NULL != password); /* NULL == digest => password != NULL */
        digest_calc_ha1_from_user (da->alg,
                                   username,
                                   realm,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]