diff -u gmemusage-0.2/debian/changelog gmemusage-0.2/debian/changelog --- gmemusage-0.2/debian/changelog +++ gmemusage-0.2/debian/changelog @@ -1,3 +1,9 @@ +gmemusage (0.2-11ubuntu1) oneiric; urgency=low + + * Fix stack smashing crash on startup, bug 370735. + + -- Akkana Peck Wed, 01 Jun 2011 10:02:33 -0700 + gmemusage (0.2-11) unstable; urgency=low * Adopt the package (Closes: #486759). only in patch2: unchanged: --- gmemusage-0.2.orig/debian/patches/30_stacksmash2.patch +++ gmemusage-0.2/debian/patches/30_stacksmash2.patch @@ -0,0 +1,94 @@ +--- common.h-dist 2009-07-08 09:48:38.000000000 -0700 ++++ common.h 2009-07-08 13:36:33.000000000 -0700 +@@ -8,11 +8,12 @@ + */ + #define kernelname "linux" + #define freename "free" ++#define PROCNAMELEN 16 + + struct ProcInfo + { + char +- procname [14] ; ++ procname [PROCNAMELEN] ; + int + totMem , + totRSS , +--- proc.c-dist 2009-07-08 09:42:11.000000000 -0700 ++++ proc.c 2009-07-08 13:39:12.000000000 -0700 +@@ -7,6 +7,7 @@ + * See file COPYING (included in this distribution) for copyright information. + */ + #include ++#include + #include + #include + #include +@@ -112,7 +113,7 @@ + char + buf [128] ; + char +- procName [14] ; ++ procName [PROCNAMELEN] ; + int + procSize , + procRSS , +@@ -183,7 +184,8 @@ + if ( !strncmp ( buf , NameLine , NameLineLen ) ) + { + /* Name: procName */ +- sscanf ( buf , "%*s %s" , procName ) ; ++ /* The field width here should correspond to PROCNAMELEN-1 */ ++ sscanf ( buf , "%*s %15s" , procName ) ; + } + else if ( !strncmp ( buf , VmSizeLine , VmSizeLineLen ) ) + { +--- hash.c-dist 2009-07-08 09:27:25.000000000 -0700 ++++ hash.c 2009-07-08 13:40:24.000000000 -0700 +@@ -7,6 +7,8 @@ + * See file COPYING (included in this distribution) for copyright information. + */ + #include ++#include ++#include + #include + #include "common.h" + +@@ -71,7 +73,7 @@ + } + /* printf("allocated %d procs\n",lastallocated); */ + thisproc = nextproc = procs ; +- strcpy ( thisproc -> procname , procname ) ; ++ strncpy ( thisproc -> procname , procname , PROCNAMELEN ) ; + thisproc -> totMem = mem ; + thisproc -> totRSS = rss ; + thisproc -> nProcs = 1 ; +@@ -98,7 +100,7 @@ + /* printf("allocated %d procs\n",lastallocated); */ + } + thisproc = procs + nProcs ; +- strcpy ( thisproc -> procname , procname ) ; ++ strncpy ( thisproc -> procname , procname , PROCNAMELEN ) ; + thisproc -> totMem = mem ; + thisproc -> totRSS = rss ; + thisproc -> nProcs = 1 ; +--- gmemusage.c-dist 2009-07-08 09:51:01.000000000 -0700 ++++ gmemusage.c 2009-07-08 13:38:53.000000000 -0700 +@@ -95,7 +95,7 @@ + void draw_window ( void ) ; + void TooSmall ( Window win , GC gc , XFontStruct *font_into ) ; + +-void main ( int argc , char **argv ) ++int main ( int argc , char **argv ) + { + int + default_height , +@@ -710,7 +710,7 @@ + /* + * We can accept alarms again + */ +- (void) signal ( SIGALRM , draw_window ) ; ++ (void) signal ( SIGALRM , (__sighandler_t)draw_window ) ; + return ; + } +