[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#732207: Fix for segfault on amd64



The attached version of debian/patches/home.diff fixes the segfaults
on amd64. As Aurelien suggests, someone probably should tackle the
real underlying issues with $HOME, but this at least fixes the
immediate issue.


Chris
-- 
Chris Lawrence <lawrencc@debian.org> - http://blog.lordsutch.com/
Index: tvtime-1.0.2/src/tvtime-command.c
===================================================================
--- tvtime-1.0.2.orig/src/tvtime-command.c	2013-12-29 22:56:03.174954919 -0500
+++ tvtime-1.0.2/src/tvtime-command.c	2013-12-29 22:56:03.141624220 -0500
@@ -39,6 +39,9 @@
 
 int main( int argc, char **argv )
 {
+    if( ! getenv( "HOME" ) ) { fprintf( stderr, "this program needs HOME\n" ); exit( 1 ); }
+    if( strlen( getenv( "HOME" ) ) > 230 ) { fprintf( stderr, "HOME is too long\n" ); exit( 1 ); }
+
     int nc = tvtime_num_commands();
     config_t *cfg;
     FILE *fifo;
Index: tvtime-1.0.2/src/tvtime-configure.c
===================================================================
--- tvtime-1.0.2.orig/src/tvtime-configure.c	2013-12-29 22:56:03.174954919 -0500
+++ tvtime-1.0.2/src/tvtime-configure.c	2013-12-29 22:56:46.594858631 -0500
@@ -16,6 +16,8 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
+#include <stdlib.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -35,6 +37,9 @@
 
 int main( int argc, char **argv )
 {
+    if( ! getenv( "HOME" ) ) { fprintf( stderr, "this program needs HOME\n" ); exit( 1 ); }
+    if( strlen( getenv( "HOME" ) ) > 230 ) { fprintf( stderr, "HOME is too long\n" ); exit( 1 ); }
+
     config_t *cfg;
 
     /*
Index: tvtime-1.0.2/src/tvtime-scanner.c
===================================================================
--- tvtime-1.0.2.orig/src/tvtime-scanner.c	2013-12-29 22:56:03.174954919 -0500
+++ tvtime-1.0.2/src/tvtime-scanner.c	2013-12-29 22:57:06.263305223 -0500
@@ -24,6 +24,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <string.h>
+#include <stdlib.h>
 #include <fcntl.h>
 #include <unistd.h>
 #ifdef HAVE_CONFIG_H
@@ -42,6 +43,9 @@
 
 int main( int argc, char **argv )
 {
+    if( ! getenv( "HOME" ) ) { fprintf( stderr, "this program needs HOME\n" ); exit( 1 ); }
+    if( strlen( getenv( "HOME" ) ) > 230 ) { fprintf( stderr, "HOME is too long\n" ); exit( 1 ); }
+
     config_t *cfg;
     station_mgr_t *stationmgr = 0;
     videoinput_t *vidin;
Index: tvtime-1.0.2/src/tvtime.c
===================================================================
--- tvtime-1.0.2.orig/src/tvtime.c	2013-12-29 22:56:03.174954919 -0500
+++ tvtime-1.0.2/src/tvtime.c	2013-12-29 22:56:03.144957290 -0500
@@ -2643,6 +2643,9 @@
 
 int main( int argc, char **argv )
 {
+    if( ! getenv( "HOME" ) ) { fprintf( stderr, "this program needs HOME\n" ); exit( 1 ); }
+    if( strlen( getenv( "HOME" ) ) > 230 ) { fprintf( stderr, "HOME is too long\n" ); exit( 1 ); }
+
     rtctimer_t *rtctimer = 0;
     int read_stdin = 1;
     int result = 0;

Reply to: