1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

Fix webdav crash bug in digest auth handling (#16003)

This commit is contained in:
Eric Warmenhoven 2023-12-12 11:44:29 -05:00 committed by GitHub
parent 44132c42b7
commit dfda186985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,10 +217,18 @@ static bool webdav_create_digest_auth(char *digest)
else if (string_starts_with(ptr, "algorithm="))
{
ptr += STRLEN_CONST("algorithm=");
sz = strchr(ptr, ',') + 1 - ptr;
webdav_st->algo = malloc(sz);
strlcpy(webdav_st->algo, ptr, sz);
ptr += sz;
if (strchr(ptr, ','))
{
sz = strchr(ptr, ',') + 1 - ptr;
webdav_st->algo = malloc(sz);
strlcpy(webdav_st->algo, ptr, sz);
ptr += sz;
}
else
{
webdav_st->algo = strdup(ptr);
ptr += strlen(ptr);
}
}
else if (string_starts_with(ptr, "opaque=\""))
{