gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated: {md5,sha256}_ext.c: fixed process


From: gnunet
Subject: [libmicrohttpd] branch master updated: {md5,sha256}_ext.c: fixed processing of initialisation error with NULL handler
Date: Mon, 17 Apr 2023 16:06:01 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new 55aa3677 {md5,sha256}_ext.c: fixed processing of initialisation error 
with NULL handler
55aa3677 is described below

commit 55aa3677af6065c96130076c85e3c672e7ba0a49
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon Apr 17 17:05:51 2023 +0300

    {md5,sha256}_ext.c: fixed processing of initialisation error with NULL 
handler
    
    Thanks Christian for spotting it and for the proper fix in 
eeb4166266659b3aa9134c70200478d1b9ab52ff
---
 src/microhttpd/md5_ext.c    | 7 +++++--
 src/microhttpd/sha256_ext.c | 7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/microhttpd/md5_ext.c b/src/microhttpd/md5_ext.c
index b7fff4b8..02cc53c9 100644
--- a/src/microhttpd/md5_ext.c
+++ b/src/microhttpd/md5_ext.c
@@ -47,8 +47,11 @@ MHD_MD5_init_one_time (struct Md5CtxExt *ctx)
     gnutls_free (ctx->handle);
     ctx->handle = NULL;
   }
-  else
-    mhd_assert (NULL != ctx->handle); /* If error is not returned, the handle 
must not be NULL */
+
+  /* If handle is NULL, the error must be set */
+  mhd_assert ((NULL != ctx->handle) || (0 != ctx->ext_error));
+  /* If error is set, the handle must be NULL */
+  mhd_assert ((0 == ctx->ext_error) || (NULL == ctx->handle));
 }
 
 
diff --git a/src/microhttpd/sha256_ext.c b/src/microhttpd/sha256_ext.c
index f8cae555..bcbe53a3 100644
--- a/src/microhttpd/sha256_ext.c
+++ b/src/microhttpd/sha256_ext.c
@@ -48,8 +48,11 @@ MHD_SHA256_init_one_time (struct Sha256CtxExt *ctx)
     gnutls_free (ctx->handle);
     ctx->handle = NULL;
   }
-  else
-    mhd_assert (NULL != ctx->handle); /* If error is not returned, the handle 
must not be NULL */
+
+  /* If handle is NULL, the error must be set */
+  mhd_assert ((NULL != ctx->handle) || (0 != ctx->ext_error));
+  /* If error is set, the handle must be NULL */
+  mhd_assert ((0 == ctx->ext_error) || (NULL == ctx->handle));
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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