aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/internal.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-06-07 17:57:26 +0200
committerChristian Grothoff <christian@grothoff.org>2022-06-07 17:57:26 +0200
commitb627fdaf25d1db7ae8e35963b5cae882881fc016 (patch)
tree895582aa55c52eda26776588dc1e347024da361a /src/microhttpd/internal.h
parent711099c7ea1d0aaa9547e5c476f3f659d9c8af16 (diff)
downloadlibmicrohttpd-b627fdaf25d1db7ae8e35963b5cae882881fc016.tar.gz
libmicrohttpd-b627fdaf25d1db7ae8e35963b5cae882881fc016.zip
-fix read-only off-by one in 'if ( (0 != memcmp (nn->nonce, nonce, noncelen)) ||
772 (0 != nn->nonce[noncelen]) )' by making buffer one element larger
Diffstat (limited to 'src/microhttpd/internal.h')
-rw-r--r--src/microhttpd/internal.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index f6452b2c..4f03b8fc 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -69,7 +69,7 @@
69 * pointer to unmodifiable data. 69 * pointer to unmodifiable data.
70 * Must not be used to transform pointers for MHD needs. 70 * Must not be used to transform pointers for MHD needs.
71 */ 71 */
72#define _MHD_DROP_CONST(ptr) ((void *)((uintptr_t)((const void *)(ptr)))) 72#define _MHD_DROP_CONST(ptr) ((void *) ((uintptr_t) ((const void *) (ptr))))
73 73
74/** 74/**
75 * @def _MHD_MACRO_NO 75 * @def _MHD_MACRO_NO
@@ -269,7 +269,7 @@ struct MHD_NonceNc
269 /** 269 /**
270 * Nonce value: 270 * Nonce value:
271 */ 271 */
272 char nonce[MAX_NONCE_LENGTH]; 272 char nonce[MAX_NONCE_LENGTH + 1];
273 273
274}; 274};
275 275
@@ -848,7 +848,7 @@ enum MHD_HTTP_Version
848 * Returns boolean 'true' if HTTP version is supported by MHD 848 * Returns boolean 'true' if HTTP version is supported by MHD
849 */ 849 */
850#define MHD_IS_HTTP_VER_SUPPORTED(ver) (MHD_HTTP_VER_1_0 <= (ver) && \ 850#define MHD_IS_HTTP_VER_SUPPORTED(ver) (MHD_HTTP_VER_1_0 <= (ver) && \
851 MHD_HTTP_VER_1_2__1_9 >= (ver)) 851 MHD_HTTP_VER_1_2__1_9 >= (ver))
852 852
853/** 853/**
854 * Protocol should be used as HTTP/1.1 protocol. 854 * Protocol should be used as HTTP/1.1 protocol.
@@ -857,7 +857,7 @@ enum MHD_HTTP_Version
857 * https://datatracker.ietf.org/doc/html/rfc7230#section-2.6 857 * https://datatracker.ietf.org/doc/html/rfc7230#section-2.6
858 */ 858 */
859#define MHD_IS_HTTP_VER_1_1_COMPAT(ver) (MHD_HTTP_VER_1_1 == (ver) || \ 859#define MHD_IS_HTTP_VER_1_1_COMPAT(ver) (MHD_HTTP_VER_1_1 == (ver) || \
860 MHD_HTTP_VER_1_2__1_9 == (ver)) 860 MHD_HTTP_VER_1_2__1_9 == (ver))
861 861
862/** 862/**
863 * The HTTP method. 863 * The HTTP method.