Skip to content

Commit 4719beb

Browse files
committed
extkeys: Correct memset zeroing in extkeys_initialize_keyset()
sizeof(100) will evaluate to 4, so this wasn't zeroing out the whole array (which is likely what was intended here). Instead, we can use a braced initializer to perform the desirable behavior here.
1 parent bdbd4f6 commit 4719beb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

extkeys.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,7 @@ void extkeys_initialize_keyset(nca_keyset_t *keyset, FILE *f) {
259259
pki_set_beta_nca0_exponent(exponent);
260260
matched_key = 1;
261261
} else {
262-
char test_name[0x100];
263-
memset(test_name, 0, sizeof(100));
262+
char test_name[0x100] = {0};
264263
for (unsigned int i = 0; i < 0x20 && !matched_key; i++) {
265264
snprintf(test_name, sizeof(test_name), "keyblob_key_source_%02"PRIx32, i);
266265
if (strcmp(key, test_name) == 0) {

0 commit comments

Comments
 (0)