Skip to content

Commit 31ab638

Browse files
committed
silence valgrind
When compiling with clang (9-12) and then running the tests in valgrind (I tested 3.13.0 and 3.15.0) the following error was created: ``` Conditional jump or move depends on uninitialised value(s) at 0x47761F: ecc_ssh_ecdsa_encode_name (ecc_ssh_ecdsa_encode_name.c:38) ... Uninitialised value was created by a stack allocation at 0x477570: ecc_ssh_ecdsa_encode_name (ecc_ssh_ecdsa_encode_name.c:21) ``` This silences this error by initialising the stack-array on creation. Signed-off-by: Steffen Jaeckel <[email protected]>
1 parent 7a8496d commit 31ab638

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pk/ecc/ecc_ssh_ecdsa_encode_name.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
int ecc_ssh_ecdsa_encode_name(char *buffer, unsigned long *buflen, const ecc_key *key)
2121
{
22-
char oidstr[64];
22+
char oidstr[64] = {0};
2323
unsigned long oidlen = sizeof(oidstr);
2424
int err, size = 0;
2525

0 commit comments

Comments
 (0)