forked from mirrors/linphone-iphone
Always store a NULL character at the end of a LinphoneBuffer.
This commit is contained in:
parent
24f4d44496
commit
8b33ed404e
1 changed files with 2 additions and 1 deletions
|
|
@ -78,8 +78,9 @@ const uint8_t * linphone_buffer_get_content(const LinphoneBuffer *buffer) {
|
|||
void linphone_buffer_set_content(LinphoneBuffer *buffer, const uint8_t *content, size_t size) {
|
||||
buffer->size = size;
|
||||
if (buffer->content) belle_sip_free(buffer->content);
|
||||
buffer->content = belle_sip_malloc(size);
|
||||
buffer->content = belle_sip_malloc(size + 1);
|
||||
memcpy(buffer->content, content, size);
|
||||
((char *)buffer->content)[size] = '\0';
|
||||
}
|
||||
|
||||
const char * linphone_buffer_get_string_content(const LinphoneBuffer *buffer) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue