[fenix] 71/127: Added patch string_alloc_crash.patch to fix segfault. Closes: #485061 Added patches include_fixes.patch and warning_fixes.patch. Closes: #485062 Thanks to Darren Salt <linux at youmustbejoking.demon.co.uk>

Peter Pentchev roam at ringlet.net
Thu Dec 17 14:39:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

roam-guest pushed a commit to branch master
in repository fenix.

commit a428e3e25492fe376fa0283d6f5384b8b15d3018
Author: Miriam Ruiz <miriam at debian.org>
Date:   Sun Jun 8 02:45:54 2008 +0000

    Added patch string_alloc_crash.patch to fix segfault. Closes: #485061
    Added patches include_fixes.patch and warning_fixes.patch. Closes: #485062
    Thanks to Darren Salt <linux at youmustbejoking.demon.co.uk>
---
 debian/changelog                        |  5 ++-
 debian/patches/include_fixes.patch      | 54 +++++++++++++++++++++++++++++++++
 debian/patches/series                   |  3 ++
 debian/patches/string_alloc_crash.patch | 47 ++++++++++++++++++++++++++++
 debian/patches/warning_fixes.patch      | 27 +++++++++++++++++
 5 files changed, 135 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 86285a3..9cc22a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
 fenix (0.92a.dfsg1-5) UNRELEASED; urgency=low
 
-  * 
+  * Added patch string_alloc_crash.patch to fix segfault
+    Thanks to Darren Salt <linux at youmustbejoking.demon.co.uk>. Closes: #485061
+  * Added patches include_fixes.patch and warning_fixes.patch.
+    Thanks to Darren Salt <linux at youmustbejoking.demon.co.uk>. Closes: #485062
 
  -- Miriam Ruiz <little_miry at yahoo.es>  Sat, 07 Jun 2008 03:35:11 +0200
 
diff --git a/debian/patches/include_fixes.patch b/debian/patches/include_fixes.patch
new file mode 100644
index 0000000..106f76e
--- /dev/null
+++ b/debian/patches/include_fixes.patch
@@ -0,0 +1,54 @@
+# Copyright (C) 2008,  Darren Salt <linux at youmustbejoking.demon.co.uk>
+# See: #485062
+
+diff -ur fenix-0.92a.dfsg1.orig/fxi/inc/g_pal.h fenix-0.92a.dfsg1/fxi/inc/g_pal.h
+--- fenix-0.92a.dfsg1.orig/fxi/inc/g_pal.h	2008-06-07 22:06:44.000000000 +0100
++++ fenix-0.92a.dfsg1/fxi/inc/g_pal.h	2008-06-07 22:06:44.000000000 +0100
+@@ -30,5 +30,6 @@
+ int pal_get (PALETTE * spal, int color, int num, Uint8 * pal);
+ int pal_set (PALETTE * spal, int color, int num, Uint8 * pal);
+ int pal_map_assign (int libid, int mapcode, PALETTE * palid);
++int pal_map_remove (int libid, int mapcode);
+ 
+ #endif
+diff -ur fenix-0.92a.dfsg1.orig/fxi/inc/grlib.h fenix-0.92a.dfsg1/fxi/inc/grlib.h
+--- fenix-0.92a.dfsg1.orig/fxi/inc/grlib.h	2008-06-07 22:13:05.000000000 +0100
++++ fenix-0.92a.dfsg1/fxi/inc/grlib.h	2008-06-07 22:13:05.000000000 +0100
+@@ -143,6 +143,7 @@
+ 
+ extern void pal_destroy(PALETTE * pal);
+ extern void pal_refresh(PALETTE * pal);
++extern void pal_use(PALETTE * pal);
+ 
+ extern PALETTE    * gr_read_pal             (file * fp) ;
+ extern PALETTE    * gr_read_pal_with_gamma  (file * fp);
+@@ -305,6 +306,7 @@
+ 
+ extern void gr_clear     (GRAPH * dest) ;
+ extern void gr_clear_as  (GRAPH * dest, int color) ;
++extern void gr_clear_region (GRAPH * dest, REGION * region)
;
+ extern void gr_put_pixel (GRAPH * dest, int x, int y, int color) ;
+ extern int  gr_get_pixel (GRAPH * dest, int x, int y) ;
+ 
+diff -ur fenix-0.92a.dfsg1.orig/fxi/src/fgc.c fenix-0.92a.dfsg1/fxi/src/fgc.c
+--- fenix-0.92a.dfsg1.orig/fxi/src/fgc.c	2008-06-07 22:34:42.000000000 +0100
++++ fenix-0.92a.dfsg1/fxi/src/fgc.c	2008-06-07 22:34:42.000000000 +0100
+@@ -49,6 +49,7 @@
+ #include "fxi.h"
+ #include "fbm.h"
+ #include "fgc.h"
++#include "g_pal.h"
+ 
+ const char * fgc_error = "";
+
+diff -ur fenix-0.92a.dfsg1.orig/fxi/src/g_fpg.c fenix-0.92a.dfsg1/fxi/src/g_fpg.c
+--- fenix-0.92a.dfsg1.orig/fxi/src/g_fpg.c	2008-06-07 22:29:46.000000000 +0100
++++ fenix-0.92a.dfsg1/fxi/src/g_fpg.c	2008-06-07 22:29:46.000000000 +0100
+@@ -46,6 +46,7 @@
+ #endif
+ 
+ #include "fxi.h"
++#include "g_pal.h"
+ 
+ #define MAXLIBS 128
+ static GRLIB * libs[MAXLIBS] ;
diff --git a/debian/patches/series b/debian/patches/series
index 77decc6..f5f0819 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -19,3 +19,6 @@ fxi_pal.patch
 fxi_sdl_mixer_use_rwops.patch
 fxi_pal_get.patch
 build_portability.patch
+include_fixes.patch
+warning_fixes.patch
+string_alloc_crash.patch
diff --git a/debian/patches/string_alloc_crash.patch b/debian/patches/string_alloc_crash.patch
new file mode 100644
index 0000000..f3614d9
--- /dev/null
+++ b/debian/patches/string_alloc_crash.patch
@@ -0,0 +1,47 @@
+# Copyright (C) 2008,  Darren Salt <linux at youmustbejoking.demon.co.uk>
+# See: #485061
+
+diff -ur fenix-0.92a.dfsg1.orig/fxi/src/strings.c fenix-0.92a.dfsg1/fxi/src/strings.c
+--- fenix-0.92a.dfsg1.orig/fxi/src/strings.c	2008-06-07 21:34:32.000000000 +0100
++++ fenix-0.92a.dfsg1/fxi/src/strings.c	2008-06-07 21:39:15.000000000 +0100
+@@ -108,9 +108,9 @@
+     string_used = 0 ;
+ 
+     string_ptr_allocated = 1024 ;
+-    string_ptr = (char **) malloc (1024 * sizeof(char *)) ;
+-    string_uct = (int *) malloc (1024 * sizeof(int)) ;
+-    string_dontfree = (char *) malloc (1024 * sizeof(char)) ;
++    string_ptr = (char **) calloc (1024, sizeof(char *)) ;
++    string_uct = (int *) calloc (1024, sizeof(int)) ;
++    string_dontfree = (char *) calloc (1024, sizeof(char)) ;
+ 
+     /* Create an empty string with ID 0 */
+     string_mem[0] = 0 ;
+@@ -131,14 +131,23 @@
+ 
+ static void string_alloc (int count)
+ {
+-    string_ptr_allocated += count ;
++    int new_allocated = string_ptr_allocated + count ;
+ 
+-    string_ptr = (char **) realloc (string_ptr, string_ptr_allocated * sizeof(char *)) ;
+-    string_uct = (int *) realloc (string_uct, string_ptr_allocated * sizeof(int)) ;
+-    string_dontfree = (char *) realloc (string_dontfree, string_ptr_allocated * sizeof(char)) ;
++    string_ptr = (char **) realloc (string_ptr, new_allocated * sizeof(char *)) ;
++    string_uct = (int *) realloc (string_uct, new_allocated * sizeof(int)) ;
++    string_dontfree = (char *) realloc (string_dontfree, new_allocated * sizeof(char)) ;
+ 
+     if (!string_ptr || !string_uct || !string_dontfree)
+         gr_error (_("string_alloc: out of memory\n")) ;
++
++    if (count > 0)
++    {
++        memset (string_ptr + string_ptr_allocated, 0, count * sizeof (char *));
++        memset (string_uct + string_ptr_allocated, 0, count * sizeof (int));
++        memset (string_dontfree + string_ptr_allocated, 0, count * sizeof (char));
++    }
++
++    string_ptr_allocated = new_allocated;
+ }
+ 
+ /****************************************************************************/
diff --git a/debian/patches/warning_fixes.patch b/debian/patches/warning_fixes.patch
new file mode 100644
index 0000000..a43b4b3
--- /dev/null
+++ b/debian/patches/warning_fixes.patch
@@ -0,0 +1,27 @@
+# Copyright (C) 2008,  Darren Salt <linux at youmustbejoking.demon.co.uk>
+# See: #485062
+
+diff -ur fenix-0.92a.dfsg1.orig/fxc/src/c_data.c fenix-0.92a.dfsg1/fxc/src/c_data.c
+--- fenix-0.92a.dfsg1.orig/fxc/src/c_data.c	2008-06-07 21:46:42.000000000 +0100
++++ fenix-0.92a.dfsg1/fxc/src/c_data.c	2008-06-07 21:49:26.000000000 +0100
+@@ -314,7 +314,7 @@
+ 
+                         if (has_parents) {
+                             token_next() ;
+-                            if (token.type != IDENTIFIER || token.code != token.type != identifier_rightp) {
++                            if (token.type != IDENTIFIER || token.code != identifier_rightp) {
+                                 compile_error (MSG_EXPECTED, ")") ;
+                             }
+                         }
+diff -ur fenix-0.92a.dfsg1.orig/fxi/src/i_main.c fenix-0.92a.dfsg1/fxi/src/i_main.c
+--- fenix-0.92a.dfsg1.orig/fxi/src/i_main.c	2008-06-07 21:46:42.000000000 +0100
++++ fenix-0.92a.dfsg1/fxi/src/i_main.c	2008-06-07 21:55:28.000000000 +0100
+@@ -416,7 +416,7 @@
+         {
+             stack_gptr = stack_ptr ;
+             stack_dump();
+-            printf ("%45s [%4u] ", " ", (ptr - base_code)) ;
++            printf ("%45s [%4zu] ", " ", (ptr - base_code)) ;
+             mnemonic_dump (*ptr, ptr[1]) ;
+             printf("\n");
+             fflush(stdout) ;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/fenix.git



More information about the Pkg-games-commits mailing list