Skip to content

Commit

Permalink
[fixup] memory handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jalle19 committed Jul 29, 2024
1 parent c96b480 commit 253a7b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ca.c
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@ static int CIPLUS_APP_OPRF_handler(ca_session_t *session, int tag,
int info_valid = (data[0] & (1 << 3)) > 0;
int info_version = data[0] & 0x07;
int cicam_original_network_id = (data[1] << 8) + data[2];
char lang_code[4];
char lang_code[4] = {0};
strncpy(lang_code, (char *)data + 10, 3);
char *profile_name = _malloc(data[13]);
strncpy(profile_name, (char *)data + 14, data[13]);
Expand All @@ -1903,6 +1903,7 @@ static int CIPLUS_APP_OPRF_handler(ca_session_t *session, int tag,
// Initiate a profile search
ca_write_apdu(session, CIPLUS_TAG_OPERATOR_SEARCH_START,
data_oprf_search, sizeof(data_oprf_search));
_free(profile_name);
break;
}
case CIPLUS_TAG_OPERATOR_TUNE: {
Expand Down

0 comments on commit 253a7b6

Please sign in to comment.