mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 05:31:44 +00:00
fixed base64 decoding
This commit is contained in:
+2
-1
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user