From b02511b216c31b1cc162b72e9a2a5bbe6286a24e Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Mon, 14 Nov 2011 08:33:44 +0000
Subject: 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)
---
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;
 }

