Fix improper use of dlog_vprint() sandbox/lstelmach/virgl
authorŁukasz Stelmach <l.stelmach@samsung.com>
Wed, 6 Dec 2023 19:46:16 +0000 (20:46 +0100)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Wed, 6 Dec 2023 21:42:57 +0000 (22:42 +0100)
Variables declared as va_list must not be referenced after va_end().

Change-Id: Ic161306eb47b593471862f406e694ee28df2773a
Fixes: 712b42a69d8 ("Implement dlog for mesa main")
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
src/mesa/main/errors.c

index e943766..c95498b 100644 (file)
@@ -163,7 +163,7 @@ _mesa_warning( struct gl_context *ctx, const char *fmtString, ... )
       flush_delayed_errors( ctx );
 
 #ifdef HAVE_TIZEN_PLATFORM
-   dlog_vprint(DLOG_WARN, LOG_TAG, fmtString, args);
+   dlog_print(DLOG_WARN, LOG_TAG, "%s", str);
 #else
    output_if_debug("Mesa warning", str, GL_TRUE);
 #endif
@@ -193,7 +193,7 @@ _mesa_problem( const struct gl_context *ctx, const char *fmtString, ... )
       vsnprintf( str, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args );
       va_end( args );
 #ifdef HAVE_TIZEN_PLATFORM
-      dlog_vprint(DLOG_WARN, LOG_TAG, fmtString, args);
+      dlog_print(DLOG_WARN, LOG_TAG, "%s", str);
 #else
       fprintf(stderr, "Mesa " PACKAGE_VERSION " implementation error: %s\n",
               str);
@@ -371,7 +371,7 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... )
       /* Print the error to stderr if needed. */
       if (do_output) {
 #ifdef HAVE_TIZEN_PLATFORM
-         dlog_vprint(DLOG_ERROR, LOG_TAG, fmtString, args);
+         dlog_print(DLOG_ERROR, LOG_TAG, "%s", s2);
 #else
          output_if_debug("Mesa: User error", s2, GL_TRUE);
 #endif
@@ -414,7 +414,7 @@ _mesa_debug( const struct gl_context *ctx, const char *fmtString, ... )
    va_end(args);
 
 #ifdef HAVE_TIZEN_PLATFORM
-   dlog_vprint(DLOG_DEBUG, LOG_TAG, fmtString, args);
+   dlog_print(DLOG_DEBUG, LOG_TAG, "%s", s);
 #else
    output_if_debug("Mesa", s, GL_FALSE);
 #endif
@@ -433,7 +433,7 @@ _mesa_log(const char *fmtString, ...)
    vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args);
    va_end(args);
 #ifdef HAVE_TIZEN_PLATFORM
-   dlog_vprint(DLOG_INFO, LOG_TAG, fmtString, args);
+   dlog_print(DLOG_INFO, LOG_TAG, "%s", s);
 #else
    output_if_debug(NULL, s, GL_FALSE);
 #endif