[aisleriot/gnome-3-2] game_scm_pre_unwind_handler(): Fix potential format string crash



commit b02511b216c31b1cc162b72e9a2a5bbe6286a24e
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]
    (cherry picked from commit 3e6a3c973992905a25a24102423322f8a4a01977)

 src/game.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/game.c b/src/game.c
index d2fa05b..c90dcd8 100644
--- a/src/game.c
+++ b/src/game.c
@@ -405,11 +405,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]