mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-21 21:28:08 +00:00
Add null character at the end of the key when storing it in a LinphoneContent (to prevent invalid reads).
This commit is contained in:
parent
4eea002784
commit
d2654ce519
1 changed files with 2 additions and 1 deletions
|
|
@ -185,8 +185,9 @@ void linphone_content_set_key(LinphoneContent *content, const char *key, const s
|
|||
content->key = NULL;
|
||||
}
|
||||
if (key != NULL) {
|
||||
content->key = belle_sip_malloc(keyLength);
|
||||
content->key = belle_sip_malloc(keyLength + 1);
|
||||
memcpy(content->key, key, keyLength);
|
||||
content->key[keyLength] = '\0';
|
||||
content->keyLength = keyLength;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue