Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/guardedalloc')
-rw-r--r--intern/guardedalloc/intern/mallocn.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c
index 83aceb12344..27170439a53 100644
--- a/intern/guardedalloc/intern/mallocn.c
+++ b/intern/guardedalloc/intern/mallocn.c
@@ -167,12 +167,13 @@ static int malloc_debug_memset= 0;
static void print_error(const char *str, ...)
{
- char buf[1024];
+ char buf[512];
va_list ap;
va_start(ap, str);
- vsprintf(buf, str, ap);
+ vsnprintf(buf, sizeof(buf), str, ap);
va_end(ap);
+ buf[sizeof(buf) - 1] = '\0';
if (error_callback) error_callback(buf);
}