mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
* utils.c (aprintf): print log message and abort if we have too big text buffer.
This commit is contained in:
parent
311f76645f
commit
0e7917cda7
@ -213,7 +213,11 @@ aprintf (const char *fmt, ...)
|
||||
if (size >= FMT_MAX_LENGTH) /* We have a huge buffer, */
|
||||
{ /* maybe we have some wrong format string? */
|
||||
free (str); /* In this case we must free already allocated memory, */
|
||||
return NULL; /* and return NULL pointer... */
|
||||
logprintf (LOG_ALWAYS,
|
||||
_("%s: aprintf: text buffer is too big (%ld bytes), \
|
||||
free already allocated memory and abort.\n"),
|
||||
exec_name, size); /* printout a log message */
|
||||
abort (); /* and abort... */
|
||||
}
|
||||
/* else, we continue to grow our buffer. */
|
||||
size <<= 1; /* twice the old size */
|
||||
|
Loading…
Reference in New Issue
Block a user