]> sjero.net Git - wget/commitdiff
* utils.c (aprintf): print log message and abort if we have too big text buffer.
authorAlexander Dergachev <cy6erbr4in@gmail.com>
Sat, 12 Apr 2008 15:13:23 +0000 (19:13 +0400)
committerAlexander Dergachev <cy6erbr4in@gmail.com>
Sat, 12 Apr 2008 15:13:23 +0000 (19:13 +0400)
src/utils.c

index 3c873d0e88df692d699774e613bf2534a4e85a0e..af621402caa4d1c5d4f3d39d4e84e69ba5f30f04 100644 (file)
@@ -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 */