gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (435cd008 -> d36dfd47)


From: gnunet
Subject: [libmicrohttpd] branch master updated (435cd008 -> d36dfd47)
Date: Sat, 28 May 2022 20:17:40 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 435cd008 test_basicauth: added new test
     new 82f42d01 MHD_str_remove_token_caseless_(): muted ASAN errors
     new d36dfd47 configure: do not use '-Wreserved-macro-identifier'

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:
 configure.ac             |  8 +++++++-
 src/microhttpd/mhd_str.c | 11 +++++++----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index ee3d5931..cac74b51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,7 +192,7 @@ AS_CASE([${enable_build_type}],[debug|debugger],
     MHD_CHECK_ADD_CC_CFLAGS([-Wgnu-null-pointer-arithmetic -Wgnu-pointer-arith 
-Wgnu-redeclared-enum], [CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wgnu-union-cast 
-Wgnu-variable-sized-type-not-at-end -Widiomatic-parentheses], [CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wmissing-noreturn 
-Wmissing-variable-declarations -Wnested-anon-types], [CFLAGS_ac])
-    MHD_CHECK_ADD_CC_CFLAGS([-Wnewline-eof -Wover-aligned -Wredundant-parens 
-Wreserved-macro-identifier], [CFLAGS_ac])
+    MHD_CHECK_ADD_CC_CFLAGS([-Wnewline-eof -Wover-aligned -Wredundant-parens], 
[CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wshift-sign-overflow -Wtautological-compare 
-Wunaligned-access], [CFLAGS_ac])
     MHD_CHECK_ADD_CC_CFLAGS([-Wunused -Wused-but-marked-unused 
-Wzero-as-null-pointer-constant -Wzero-length-array], [CFLAGS_ac])
 
@@ -247,6 +247,12 @@ AS_CASE([${enable_build_type}],[release|release-*],
     LDFLAGS="${LDFLAGS_ac} ${user_LDFLAGS}"
   ]
 )
+AS_VAR_IF([enable_build_type],["neutral"],[],
+  [ # Any non-neutral build types, final additional flags
+    CFLAGS="${user_CFLAGS}"
+    MHD_CHECK_ADD_CC_CFLAGS([-Wno-reserved-macro-identifier], [CFLAGS_ac])
+  ]
+)
 CFLAGS="${CFLAGS_ac} ${user_CFLAGS}"
 # Additional flags are checked and added at the end of 'configure'
 
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index 484de105..ece6ef44 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -627,7 +627,7 @@ MHD_str_remove_token_caseless_ (const char *str,
     copy_size = (size_t) (s1 - cur_token);
     if (buf == s2)
     { /* The first token to copy to the output */
-      if (buf + *buf_size < s2 + copy_size)
+      if (*buf_size < copy_size)
       { /* Not enough space in the output buffer */
         *buf_size = (ssize_t) -1;
         return false;
@@ -635,7 +635,8 @@ MHD_str_remove_token_caseless_ (const char *str,
     }
     else
     { /* Some token was already copied to the output buffer */
-      if (buf + *buf_size < s2 + copy_size + 2)
+      mhd_assert (s2 > buf);
+      if (*buf_size < ((size_t) (s2 - buf)) + copy_size + 2)
       { /* Not enough space in the output buffer */
         *buf_size = (ssize_t) -1;
         return false;
@@ -659,7 +660,8 @@ MHD_str_remove_token_caseless_ (const char *str,
       while ( ((size_t) (s1 - str) < str_len) &&
               (',' != *s1) && (' ' != *s1) && ('\t' != *s1) )
       {
-        if (buf + *buf_size <= s2) /* '<= s2' equals '< s2 + 1' */
+        mhd_assert (s2 >= buf);
+        if (*buf_size <= (size_t) (s2 - buf)) /* '<= s2' equals '< s2 + 1' */
         { /* Not enough space in the output buffer */
           *buf_size = (ssize_t) -1;
           return false;
@@ -678,7 +680,8 @@ MHD_str_remove_token_caseless_ (const char *str,
        * the input string */
       if (((size_t) (s1 - str) < str_len) && (',' != *s1))
       { /* Not the end of the current token */
-        if (buf + *buf_size <= s2) /* '<= s2' equals '< s2 + 1' */
+        mhd_assert (s2 >= buf);
+        if (*buf_size <= (size_t) (s2 - buf)) /* '<= s2' equals '< s2 + 1' */
         { /* Not enough space in the output buffer */
           *buf_size = (ssize_t) -1;
           return false;

-- 
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]