summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2018-03-28 02:02:45 +0100
committerrofl0r <rofl0r@users.noreply.github.com>2018-03-29 00:40:18 +0100
commit0aad2f5b92c7690a25f849ffa0f7a41ee8b5ff46 (patch)
tree3b276c62a17c5e20b280cebd84f5bc2e8ecf9611
parentae0cbfe3f2f6d6c2ac3734b7b2026c9a8502c200 (diff)
fix basicauth string comparison
closes #160
-rw-r--r--src/basicauth.c5
1 files 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;