From 0aad2f5b92c7690a25f849ffa0f7a41ee8b5ff46 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Wed, 28 Mar 2018 02:02:45 +0100 Subject: [PATCH] fix basicauth string comparison closes #160 --- src/basicauth.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/basicauth.c b/src/basicauth.c index 7092657..d6c2420 100644 --- a/src/basicauth.c +++ b/src/basicauth.c @@ -83,16 +83,15 @@ void basicauth_add (vector_t authlist, int basicauth_check (vector_t authlist, const char *authstring) { ssize_t vl, i; - size_t al, el; + size_t el; const char* entry; vl = vector_length (authlist); if (vl == -EINVAL) return 0; - al = strlen (authstring); for (i = 0; i < vl; i++) { entry = vector_getentry (authlist, i, &el); - if (strncmp (authstring, entry, al) == 0) + if (strcmp (authstring, entry) == 0) return 1; } return 0;