From 0e7917cda7c06b223745fb9ff95b2f129eee55de Mon Sep 17 00:00:00 2001 From: Alexander Dergachev Date: Sat, 12 Apr 2008 19:13:23 +0400 Subject: [PATCH] * utils.c (aprintf): print log message and abort if we have too big text buffer. --- src/utils.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index 3c873d0e..af621402 100644 --- a/src/utils.c +++ b/src/utils.c @@ -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 */ -- 2.39.2