Package: overkill Version: 0.16-13 Severity: normal Tags: patch User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu karmic ubuntu-patch
Four crashing bugs have been reported against overkill in Ubuntu and subsequently fixed: https://bugs.edge.launchpad.net/ubuntu/+source/overkill/+bug/406046 https://bugs.edge.launchpad.net/ubuntu/+source/overkill/+bug/408557 https://bugs.edge.launchpad.net/ubuntu/+source/overkill/+bug/406000 https://bugs.edge.launchpad.net/ubuntu/+source/overkill/+bug/297913 Included should be the patch we have applied in Ubuntu to fix these problems. *** /tmp/tmpuiWJu4 In Ubuntu, we've applied the attached patch to achieve the following: * Add dpatch patchsys: - debian/control: Add build-dependency on dpatch - debian/rules: Update for dpatch - Add debian/patches directory * Apply patches to fix four crashing bugs. All patches thanks to Jannich Brendle: - ubuntu_01_server_action_crash.dpatch: Patch to fix overkill-server crashes when anything happens in the game (LP: #406046) - ubuntu_02_overkill-test-server_segfault.dpatch: Patch to fix segfault in overkill-test-server due to invalid memory allocation (LP: #406000) - ubuntu_03_chat_buffer_overflow.dpatch: Patch to fix buffer overflow when sending chat messages over the specified limit (LP: #408557) - ubuntu_04_console.c_segfault.dpatch: Patch to fix overkill crashing on startup due to the code trying to copy 16 bytes into a 8 byte array (LP: #297913) We thought you might be interested in doing the same. -- System Information: Debian Release: 5.0 APT prefers jaunty-updates APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500, 'jaunty-proposed'), (500, 'jaunty-backports'), (500, 'jaunty') Architecture: amd64 (x86_64) Kernel: Linux 2.6.28-14-generic (SMP w/3 CPU cores) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash
diff -u overkill-0.16/debian/changelog overkill-0.16/debian/changelog diff -u overkill-0.16/debian/rules overkill-0.16/debian/rules --- overkill-0.16/debian/rules +++ overkill-0.16/debian/rules @@ -2,6 +2,8 @@ # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. +include /usr/share/dpatch/dpatch.make + # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 @@ -25,14 +27,14 @@ touch configure-stamp build: configure-stamp build-stamp build-man-stamp -build-stamp: +build-stamp: patch-stamp dh_testdir $(MAKE) all touch build-stamp -clean: +clean: unpatch dh_testdir dh_testroot rm -f build-stamp configure-stamp build-man-stamp only in patch2: unchanged: --- overkill-0.16.orig/debian/patches/ubuntu_02_overkill-test-server_segfault.dpatch +++ overkill-0.16/debian/patches/ubuntu_02_overkill-test-server_segfault.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## ubuntu_02_overkill-test-server_segfault.dpatch by David Futcher <bo...@ubuntu.com> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +...@dpatch@ +diff -urNad overkill-0.16~/test_server.c overkill-0.16/test_server.c +--- overkill-0.16~/test_server.c 2001-12-15 17:51:49.000000000 +0000 ++++ overkill-0.16/test_server.c 2009-08-09 13:54:34.000000000 +0100 +@@ -116,7 +116,7 @@ + exit(0); + + case 'a': +- name=mem_realloc(name,strlen(optarg)+1); ++ name=mem_alloc(strlen(optarg)+1); + memcpy(name,optarg,strlen(optarg)+1); + break; + only in patch2: unchanged: --- overkill-0.16.orig/debian/patches/ubuntu_03_chat_buffer_overflow.dpatch +++ overkill-0.16/debian/patches/ubuntu_03_chat_buffer_overflow.dpatch @@ -0,0 +1,30 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## ubuntu_03_chat_buffer_overflow.dpatch by David Futcher <bo...@ubuntu.com> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +...@dpatch@ +diff -urNad overkill-0.16~/client.c overkill-0.16/client.c +--- overkill-0.16~/client.c 2009-08-09 13:40:59.000000000 +0100 ++++ overkill-0.16/client.c 2009-08-09 13:55:34.000000000 +0100 +@@ -508,9 +508,16 @@ + int a; + + a=strlen(msg)+1; +- packet[0]=P_MESSAGE; +- memcpy(packet+1,msg,a); +- send_packet(packet,a+1,(struct sockaddr *)(&server),my_id,0); ++ if(a<=MAX_MESSAGE_LENGTH) { ++ packet[0]=P_MESSAGE; ++ memcpy(packet+1,msg,a); ++ send_packet(packet,a+1,(struct sockaddr *)(&server),my_id,0); ++ } else { ++ packet[0]=P_MESSAGE; ++ memcpy(packet+1,msg,70); ++ send_packet(packet,a+1,(struct sockaddr *)(&server),my_id,0); ++ send_message(msg+70); ++ } + } + + only in patch2: unchanged: --- overkill-0.16.orig/debian/patches/00list +++ overkill-0.16/debian/patches/00list @@ -0,0 +1,4 @@ +ubuntu_01_server_action_crash.dpatch +ubuntu_02_overkill-test-server_segfault.dpatch +ubuntu_03_chat_buffer_overflow.dpatch +ubuntu_04_console.c_segfault.dpatch only in patch2: unchanged: --- overkill-0.16.orig/debian/patches/ubuntu_01_server_action_crash.dpatch +++ overkill-0.16/debian/patches/ubuntu_01_server_action_crash.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## ubuntu_01_server_action_crash.dpatch by David Futcher <bo...@ubuntu.com> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +...@dpatch@ +diff -urNad overkill-0.16~/server.c overkill-0.16/server.c +--- overkill-0.16~/server.c 2009-08-09 13:40:59.000000000 +0100 ++++ overkill-0.16/server.c 2009-08-09 13:53:08.000000000 +0100 +@@ -905,8 +905,8 @@ + int len; + + packet[0]=P_MESSAGE; +- if (!name){snprintf(packet+1,256,"%s",msg);len=strlen(msg)+1+1;} +- else {snprintf(packet+1,256,"%s> %s",name,msg);len=strlen(name)+strlen(msg)+1+3;} ++ if (!name){snprintf(packet+1,255,"%s",msg);len=strlen(msg)+1+1;} ++ else {snprintf(packet+1,255,"%s> %s",name,msg);len=strlen(name)+strlen(msg)+1+3;} + send_chunk_packet_to_player(packet,len,player); + } + only in patch2: unchanged: --- overkill-0.16.orig/debian/patches/ubuntu_04_console.c_segfault.dpatch +++ overkill-0.16/debian/patches/ubuntu_04_console.c_segfault.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## ubuntu_04_console.c_segfault.dpatch by David Futcher <bo...@ubuntu.com> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +...@dpatch@ +diff -urNad overkill-0.16~/console.c overkill-0.16/console.c +--- overkill-0.16~/console.c 2001-12-15 17:51:50.000000000 +0000 ++++ overkill-0.16/console.c 2009-08-09 13:57:01.000000000 +0100 +@@ -206,7 +206,7 @@ + void c_setcolor_3b(unsigned char a) + { + char txt[8]; +- snprintf(txt,16,"\033[%dm",30+(a&7)); ++ snprintf(txt,8,"\033[%dm",30+(a&7)); + my_print(txt); + } +