mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix buffer overrun in SRP (#7484)
The old code got a pointer to the array instead of the first element, this resulted in a buffer overflow when the function was used more than once.
This commit is contained in:
parent
e66d5e500c
commit
85ce23b165
1 changed files with 1 additions and 1 deletions
|
@ -612,7 +612,7 @@ SRP_Result srp_create_salted_verification_key( SRP_HashAlgorithm alg,
|
||||||
if (fill_buff() != SRP_OK) goto error_and_exit;
|
if (fill_buff() != SRP_OK) goto error_and_exit;
|
||||||
*bytes_s = (unsigned char *)srp_alloc(size_to_fill);
|
*bytes_s = (unsigned char *)srp_alloc(size_to_fill);
|
||||||
if (!*bytes_s) goto error_and_exit;
|
if (!*bytes_s) goto error_and_exit;
|
||||||
memcpy(*bytes_s, &g_rand_buff + g_rand_idx, size_to_fill);
|
memcpy(*bytes_s, &g_rand_buff[g_rand_idx], size_to_fill);
|
||||||
g_rand_idx += size_to_fill;
|
g_rand_idx += size_to_fill;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue