Skip to content

Commit

Permalink
Fix buffer overrun in SRP (#7484)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
red-001 authored and nerzhul committed Jun 26, 2018
1 parent ae8ae6c commit 7bdf5ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/srp.cpp
Expand Up @@ -613,7 +613,7 @@ SRP_Result srp_create_salted_verification_key( SRP_HashAlgorithm alg,
if (fill_buff() != SRP_OK) goto error_and_exit;
*bytes_s = (unsigned char *)srp_alloc(size_to_fill);
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;
}

Expand Down

0 comments on commit 7bdf5ea

Please sign in to comment.