forked from Mirrors/freeswitch
[Unit-tests] Fix possible overflows and an undefined variable in the test framework.
This commit is contained in:
parent
0f445e1ddd
commit
cced3e7f1b
|
@ -255,7 +255,7 @@ fctstr_safe_cpy(char *dst, char const *src, size_t num)
|
|||
#if defined(WIN32) && _MSC_VER >= 1400
|
||||
strncpy_s(dst, num, src, _TRUNCATE);
|
||||
#else
|
||||
strncpy(dst, src, num);
|
||||
strncpy(dst, src, num - 1);
|
||||
#endif
|
||||
dst[num-1] = '\0';
|
||||
}
|
||||
|
@ -760,6 +760,7 @@ fct_nlist__init2(fct_nlist_t *list, size_t start_sz)
|
|||
list->itm_list = (void**)malloc(sizeof(void*)*start_sz);
|
||||
if ( list->itm_list == NULL )
|
||||
{
|
||||
list->used_itm_num = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue