mesh: fix possible NULL dereference in bt_test_print_credentials
@@ -171,6 +171,7 @@ void bt_test_print_credentials(void)
console_printf("Friend cred: %d\n", i);
console_printf("\tNetKeyIdx: %04x\n",
sub[i].net_idx);
+ if (subnet) {
console_printf("\tNID: %02x\n", subnet->keys->msg.nid);
console_printf("\tEncKey: %s\n",
bt_hex(subnet->keys->msg.enc, 16));
@@ -178,6 +179,7 @@ void bt_test_print_credentials(void)
bt_hex(subnet->keys->msg.privacy, 16));
}
}
+}
int bt_test_shell_init(void)
{
