mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
dmasprintf: check negatif size case
This commit is contained in:
parent
67891bd0e4
commit
da40d40d35
1 changed files with 2 additions and 0 deletions
|
|
@ -136,6 +136,8 @@ char **s, const char *format, ...
|
|||
va_start(arg,format);
|
||||
va_copy(argcopy, arg);
|
||||
size = vsnprintf(NULL, 0, format, argcopy);
|
||||
if (size < 0)
|
||||
return -1;
|
||||
va_end(argcopy);
|
||||
#ifdef WITH_MEMTRACK
|
||||
str = (char *)__dmcalloc(file, func, line, sizeof(char), size+1);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue