diff options
Diffstat (limited to 'src/egl/main/egllog.c')
-rw-r--r-- | src/egl/main/egllog.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c index 8f3bae2243d..12c55f901a5 100644 --- a/src/egl/main/egllog.c +++ b/src/egl/main/egllog.c @@ -151,6 +151,7 @@ _eglLog(EGLint level, const char *fmtStr, ...) { va_list args; char msg[MAXSTRING]; + int ret; /* one-time initialization; a little race here is fine */ if (!logging.initialized) @@ -162,7 +163,9 @@ _eglLog(EGLint level, const char *fmtStr, ...) if (logging.logger) { va_start(args, fmtStr); - vsnprintf(msg, MAXSTRING, fmtStr, args); + ret = vsnprintf(msg, MAXSTRING, fmtStr, args); + if (ret < 0 || ret >= MAXSTRING) + strcpy(msg, "<message truncated>"); va_end(args); logging.logger(level, msg); |