Commit d2654ce5 authored by Ghislain MARY's avatar Ghislain MARY

Add null character at the end of the key when storing it in a LinphoneContent...

Add null character at the end of the key when storing it in a LinphoneContent (to prevent invalid reads).
parent 4eea0027
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment