Skip to content

Commit 7bdf5ea

Browse files
red-001nerzhul
authored andcommittedJun 26, 2018
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.
1 parent ae8ae6c commit 7bdf5ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎src/util/srp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ SRP_Result srp_create_salted_verification_key( SRP_HashAlgorithm alg,
613613
if (fill_buff() != SRP_OK) goto error_and_exit;
614614
*bytes_s = (unsigned char *)srp_alloc(size_to_fill);
615615
if (!*bytes_s) goto error_and_exit;
616-
memcpy(*bytes_s, &g_rand_buff + g_rand_idx, size_to_fill);
616+
memcpy(*bytes_s, &g_rand_buff[g_rand_idx], size_to_fill);
617617
g_rand_idx += size_to_fill;
618618
}
619619

0 commit comments

Comments
 (0)
Please sign in to comment.