mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
Ensure the login information is null-terminated.
This commit is contained in:
parent
1791e05346
commit
f521285d75
1 changed files with 6 additions and 1 deletions
7
html.c
7
html.c
|
@ -132,7 +132,12 @@ int login(snac *snac, char *headers)
|
||||||
int sz;
|
int sz;
|
||||||
xs *s1 = xs_crop(xs_dup(auth), 6, 0);
|
xs *s1 = xs_crop(xs_dup(auth), 6, 0);
|
||||||
xs *s2 = xs_base64_dec(s1, &sz);
|
xs *s2 = xs_base64_dec(s1, &sz);
|
||||||
xs *l1 = xs_split_n(s2, ":", 1);
|
|
||||||
|
/* copy to asciiz it */
|
||||||
|
xs *s3 = calloc(sz + 1, 1);
|
||||||
|
memcpy(s3, s2, sz);
|
||||||
|
|
||||||
|
xs *l1 = xs_split_n(s3, ":", 1);
|
||||||
|
|
||||||
if (xs_list_len(l1) == 2) {
|
if (xs_list_len(l1) == 2) {
|
||||||
logged_in = check_password(
|
logged_in = check_password(
|
||||||
|
|
Loading…
Reference in a new issue