Skip to content

Commit

Permalink
Fix overflow (credit @wangweij)
Browse files Browse the repository at this point in the history
Signed-off-by: Spencer Wilson <[email protected]>
  • Loading branch information
SWilson4 committed Aug 9, 2024
1 parent 2acfd96 commit 1aa3d47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/example_sig_stfl.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static OQS_STATUS stfl_example(char *method_name) {
* Allocate storage for public key, secret key filename, message and signature
*/
public_key = malloc(sig->length_public_key);
sk_fname = malloc(strlen(method_name) + strlen(".sk"));
sk_fname = malloc(strlen(method_name) + strlen(".sk") + 1);
message = malloc(message_len);
signature = malloc(sig->length_signature);
if ((public_key == NULL) || (message == NULL) || (signature == NULL) || (sk_fname == NULL)) {
Expand Down

0 comments on commit 1aa3d47

Please sign in to comment.