mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 03:58:08 +00:00
Fix invalid read in vcard tester
This commit is contained in:
parent
c163b1a492
commit
04e2b9f4b5
1 changed files with 2 additions and 1 deletions
|
|
@ -84,9 +84,10 @@ static void linphone_vcard_import_a_lot_of_friends_test(void) {
|
|||
fseek(infile, 0L, SEEK_END);
|
||||
numbytes = ftell(infile);
|
||||
fseek(infile, 0L, SEEK_SET);
|
||||
buffer = (char*)ms_malloc(numbytes * sizeof(char));
|
||||
buffer = (char*)ms_malloc((numbytes + 1) * sizeof(char));
|
||||
numbytes = fread(buffer, sizeof(char), numbytes, infile);
|
||||
fclose(infile);
|
||||
buffer[numbytes] = '\0';
|
||||
|
||||
start = clock();
|
||||
linphone_friend_list_import_friends_from_vcard4_buffer(lfl, buffer);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue