Package: teeworlds Version: 0.4.3-1 Severity: important Tags: patch -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Two swap_endian() calls in e_datafile.c pass the size in bytes instead of in number of units to be swapped, resulting in memory corruption and consequent crashes. The attached patch fixes this and allows teeworlds to work on my PowerBook. - -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'stable'), (102, 'experimental') Architecture: powerpc (ppc) Kernel: Linux 2.6.27.2 Locale: LANG=de_CH.UTF-8, LC_CTYPE=de_CH.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages teeworlds depends on: ii libc6 2.7-15 GNU C Library: Shared libraries ii libgcc1 1:4.3.2-1 GCC support library ii libgl1-mesa-glx [libgl 7.0.3-6 A free implementation of the OpenG ii libglu1-mesa [libglu1] 7.0.3-6 The OpenGL utility library (GLU) ii libportaudio2 19+svn20071022-3 Portable audio I/O - shared librar ii libstdc++6 4.3.2-1 The GNU Standard C++ Library v3 ii libwavpack1 4.50.1-1 an audio codec (lossy and lossless ii libx11-6 2:1.1.5-2 X11 client-side library ii libxrandr2 2:1.2.3-1 X11 RandR extension library ii teeworlds-data 0.4.3-1 Data for Teeworlds; an online mult ii zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime teeworlds recommends no packages. Versions of packages teeworlds suggests: ii teeworlds-server 0.4.3-1 Server for Teeworlds; an online mu - -- no debconf information -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iD8DBQFJEtovWoGvjmrbsgARAgdFAJ9IYHfVaphwjHwb6UT9qX4897YDVQCeM/WW bT7btidgNQ8LD9TXGz5uU1o= =qErH -----END PGP SIGNATURE-----
diff -up -ru teeworlds-0.4.3.orig/src/engine/e_datafile.c teeworlds-0.4.3/src/engine/e_datafile.c --- teeworlds-0.4.3.orig/src/engine/e_datafile.c 2008-11-06 12:19:08.000000000 +0100 +++ teeworlds-0.4.3/src/engine/e_datafile.c 2008-11-06 12:07:02.000000000 +0100 @@ -137,7 +137,7 @@ DATAFILE *datafile_load(const char *file } #if defined(CONF_ARCH_ENDIAN_BIG) - swap_endian(df->data, sizeof(int), header.swaplen); + swap_endian(df->data, sizeof(int), header.swaplen/sizeof(int)); #endif if(DEBUG) @@ -261,7 +261,7 @@ void *datafile_get_data_swapped(DATAFILE return ptr; #if defined(CONF_ARCH_ENDIAN_BIG) - swap_endian(ptr, sizeof(int), size); + swap_endian(ptr, sizeof(int), size/sizeof(int)); #endif return ptr;