diff options
Diffstat (limited to 'intern/guardedalloc')
-rw-r--r-- | intern/guardedalloc/intern/mallocn.c | 5 |
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); } |