aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/digestauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/digestauth.c')
-rw-r--r--src/microhttpd/digestauth.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index c66bcadf..8f04bf38 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -732,6 +732,7 @@ calculate_nonce (uint32_t nonce_time,
732 * @param connection the connection 732 * @param connection the connection
733 * @param key the key 733 * @param key the key
734 * @param value the value, can be NULL 734 * @param value the value, can be NULL
735 * @param value_size number of bytes in @a value
735 * @param kind type of the header 736 * @param kind type of the header
736 * @return #MHD_YES if the key-value pair is in the headers, 737 * @return #MHD_YES if the key-value pair is in the headers,
737 * #MHD_NO if not 738 * #MHD_NO if not
@@ -740,6 +741,7 @@ static int
740test_header (struct MHD_Connection *connection, 741test_header (struct MHD_Connection *connection,
741 const char *key, 742 const char *key,
742 const char *value, 743 const char *value,
744 size_t value_size,
743 enum MHD_ValueKind kind) 745 enum MHD_ValueKind kind)
744{ 746{
745 struct MHD_HTTP_Header *pos; 747 struct MHD_HTTP_Header *pos;
@@ -748,6 +750,8 @@ test_header (struct MHD_Connection *connection,
748 { 750 {
749 if (kind != pos->kind) 751 if (kind != pos->kind)
750 continue; 752 continue;
753 if (value_size != pos->value_size)
754 continue;
751 if (0 != strcmp (key, 755 if (0 != strcmp (key,
752 pos->header)) 756 pos->header))
753 continue; 757 continue;
@@ -756,8 +760,9 @@ test_header (struct MHD_Connection *connection,
756 return MHD_YES; 760 return MHD_YES;
757 if ( (NULL == value) || 761 if ( (NULL == value) ||
758 (NULL == pos->value) || 762 (NULL == pos->value) ||
759 (0 != strcmp (value, 763 (0 != memcmp (value,
760 pos->value)) ) 764 pos->value,
765 value_size)) )
761 continue; 766 continue;
762 return MHD_YES; 767 return MHD_YES;
763 } 768 }