gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (1b610e5b -> 312713c3


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (1b610e5b -> 312713c3)
Date: Mon, 08 Apr 2019 15:12:48 +0200

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

grothoff pushed a change to branch master
in repository libmicrohttpd.

    from 1b610e5b allow binary zero in unescaped GET arguments (see mailinglist)
     new 83a86be9 fix close() checks
     new 312713c3 merge

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:
 ChangeLog                 | 4 ++++
 src/lib/internal.h        | 6 +++---
 src/lib/mhd_itc.h         | 6 ++++--
 src/microhttpd/internal.h | 6 +++---
 src/microhttpd/mhd_itc.h  | 6 ++++--
 5 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 32868ca0..58b87e3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon 08 Apr 2019 03:06:05 PM CEST
+       Fix close() checks as suggested by MK on the mailinglist
+        (#3926). -MK/CG
+
 Wed 20 Mar 2019 10:20:24 AM CET
        Adding additional "value_length" argument to MHD_KeyValueIterator
        callback to support binary zeros in values.  This is done in a
diff --git a/src/lib/internal.h b/src/lib/internal.h
index c6d7bec6..bd3bd1c6 100644
--- a/src/lib/internal.h
+++ b/src/lib/internal.h
@@ -92,9 +92,9 @@ MHD_DLOG (const struct MHD_Daemon *daemon,
  * Close FD and abort execution if error is detected.
  * @param fd the FD to close
  */
-#define MHD_fd_close_chk_(fd) do {             \
-    if (0 == close ((fd)) && (EBADF == errno)) \
-      MHD_PANIC(_("Failed to close FD.\n"));   \
+#define MHD_fd_close_chk_(fd) do {                      \
+    if ( (0 != close ((fd)) && (EBADF == errno)) )     \
+      MHD_PANIC(_("Failed to close FD.\n"));            \
   } while(0)
 
 /**
diff --git a/src/lib/mhd_itc.h b/src/lib/mhd_itc.h
index 7bfccf30..01331f13 100644
--- a/src/lib/mhd_itc.h
+++ b/src/lib/mhd_itc.h
@@ -108,11 +108,13 @@ static const uint64_t _MHD_itc_wr_data = 1;
        (void)__r; } while(0)
 
 /**
- * Destroy previously initialised ITC
+ * Destroy previously initialised ITC.  Note that close()
+ * on some platforms returns odd errors, so we ONLY fail
+ * if the errno is EBADF.
  * @param itc the itc to destroy
  * @return non-zero if succeeded, zero otherwise
  */
-#define MHD_itc_destroy_(itc) ((0 != close ((itc).fd)) || (EBADF != errno))
+#define MHD_itc_destroy_(itc) ((0 == close ((itc).fd)) || (EBADF != errno))
 
 /**
  * Check whether ITC has valid value.
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 63bccd94..f77ebd10 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -77,9 +77,9 @@
  * Close FD and abort execution if error is detected.
  * @param fd the FD to close
  */
-#define MHD_fd_close_chk_(fd) do {             \
-    if (0 == close ((fd)) && (EBADF == errno)) \
-      MHD_PANIC(_("Failed to close FD.\n"));   \
+#define MHD_fd_close_chk_(fd) do {                      \
+    if ( (0 != close ((fd)) && (EBADF == errno)) )     \
+      MHD_PANIC(_("Failed to close FD.\n"));            \
   } while(0)
 
 /**
diff --git a/src/microhttpd/mhd_itc.h b/src/microhttpd/mhd_itc.h
index 7bfccf30..01331f13 100644
--- a/src/microhttpd/mhd_itc.h
+++ b/src/microhttpd/mhd_itc.h
@@ -108,11 +108,13 @@ static const uint64_t _MHD_itc_wr_data = 1;
        (void)__r; } while(0)
 
 /**
- * Destroy previously initialised ITC
+ * Destroy previously initialised ITC.  Note that close()
+ * on some platforms returns odd errors, so we ONLY fail
+ * if the errno is EBADF.
  * @param itc the itc to destroy
  * @return non-zero if succeeded, zero otherwise
  */
-#define MHD_itc_destroy_(itc) ((0 != close ((itc).fd)) || (EBADF != errno))
+#define MHD_itc_destroy_(itc) ((0 == close ((itc).fd)) || (EBADF != errno))
 
 /**
  * Check whether ITC has valid value.

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



reply via email to

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