fixed base64 decoding

This commit is contained in:
Unbit
2013-03-01 14:58:51 +01:00
parent f53c79cce7
commit 6a94d1f91c
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -3652,7 +3652,7 @@ char *uwsgi_base64_decode(char *buf, size_t len, size_t *d_len) {
// compute the new size
*d_len = (((len+3)/4) * 3);
char *dst = uwsgi_malloc(*d_len);
char *dst = uwsgi_malloc(*d_len + 1);
char *ptr = dst;
uint8_t *src = (uint8_t *) buf;
@@ -3674,6 +3674,7 @@ char *uwsgi_base64_decode(char *buf, size_t len, size_t *d_len) {
}
*d_len = (ptr - dst);
*ptr++= 0;
return dst;
+1 -1
View File
@@ -80,7 +80,7 @@ int uwsgi_routing_func_basicauth(struct wsgi_request *wsgi_req, struct uwsgi_rou
}
}
else {
if (!strcmp(auth, ur->data2)) {
if (!uwsgi_strncmp(auth, auth_len, ur->data2, ur->data2_len)) {
wsgi_req->remote_user = uwsgi_req_append(wsgi_req, "REMOTE_USER", 11, auth, ur->custom);
if (wsgi_req->remote_user)
wsgi_req->remote_user_len = ur->custom;