[aisleriot] game_scm_pre_unwind_handler(): Fix potential format string crash



commit 3e6a3c973992905a25a24102423322f8a4a01977
Author: Martin Pitt <martin pitt ubuntu com>
Date:   Mon Nov 14 09:33:44 2011 +0100

    game_scm_pre_unwind_handler(): Fix potential format string crash
    
    Use g_set_error_literal() for setting the error message to the stack trace, as
    this might contain format string macros. Spotted by building with
    -Werror=format-security:
    
    game.c: In function 'game_scm_pre_unwind_handler':
    game.c:425:24: error: format not a string literal and no format arguments [-Werror=format-security]

 src/game.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/game.c b/src/game.c
index 83e3e3a..80009d2 100644
--- a/src/game.c
+++ b/src/game.c
@@ -418,11 +418,11 @@ game_scm_pre_unwind_handler (void *user_data,
     return SCM_UNDEFINED;
 
   message = cscmi_exception_get_backtrace (tag, throw_args);
-  g_set_error (error,
-               AISLERIOT_GAME_ERROR,
-               GAME_ERROR_EXCEPTION,
-               message ? message
-                       : "A scheme exception occurred, but there was no exception info");
+  g_set_error_literal (error,
+                       AISLERIOT_GAME_ERROR,
+                       GAME_ERROR_EXCEPTION,
+                       message ? message
+                               : "A scheme exception occurred, but there was no exception info");
   return SCM_UNDEFINED;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]