Bug#343669: tlf: several valgrind hits at startup (may result in crash)

2005-12-19 Thread Joop PG4I
On 12/17/05, Joop PG4I [EMAIL PROTECTED] wrote:
Thanks Steinar,I wil forward the patch to upstream.Regards,Joop pa3aba at debian dot org - tlf maintainer

Upstream has released 0.9.26, which includes your patch. I can't currently upload a new debian package: I lost my PGP key due to a harddisk crash :-(-- Linux for your hamradio desktop
___http://www.qsl.net/pg4i/linux


Bug#343669: tlf: several valgrind hits at startup (may result in crash)

2005-12-17 Thread Joop PG4I
Thanks Steinar,I wil forward the patch to upstream.Regards,Joop pa3aba at debian dot org - tlf maintainer


Bug#343669: tlf: several valgrind hits at startup (may result in crash)

2005-12-16 Thread Steinar H. Gunderson
Package: tlf
Version: 0.9.25-1
Severity: important
Tags: patch

Hi,

tlf has several valgrind hits, mostly going outside its buffers or
reading uninitialized data. This seems to make it crash in some
situations and on some machines. The included patch should fix at least
the ones during startup.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)

Versions of packages tlf depends on:
ii  hamlib3   1.2.4-3Run-time library to control radio 
ii  libc6 2.3.5-8.1  GNU C Library: Shared libraries an
ii  libncurses5   5.5-1  Shared libraries for terminal hand

Versions of packages tlf recommends:
ii  cwdaemon  0.9.2  morse daemon for the parallel or s

-- debconf-show failed
diff -ur tlf-0.9.25/src/parse_logcfg.c tlf-0.9.25.patched/src/parse_logcfg.c
--- tlf-0.9.25/src/parse_logcfg.c	2005-11-15 14:43:03.0 +0100
+++ tlf-0.9.25.patched/src/parse_logcfg.c	2005-12-17 02:21:33.0 +0100
@@ -406,7 +406,7 @@
 	char *tk_ptr;
 
 
-	for (ii = 0; ii = MAX_COMMANDS; ii++) {
+	for (ii = 0; ii  MAX_COMMANDS; ii++) {
 
 		teststring[0] = '\0';
 		strncat(teststring, commands[ii], 79);
diff -ur tlf-0.9.25/src/readctydata.c tlf-0.9.25.patched/src/readctydata.c
--- tlf-0.9.25/src/readctydata.c	2005-11-15 14:43:03.0 +0100
+++ tlf-0.9.25.patched/src/readctydata.c	2005-12-17 02:19:29.0 +0100
@@ -77,7 +77,9 @@
 while ( !feof(fp_db))
 {
 // 	fgets (buf,  180,  fp_db);		### bug fix
- 	fgets (buf,  sizeof(buf),  fp_db);
+		if (fgets (buf,  sizeof(buf),  fp_db) == NULL) {
+			break;
+		}
 
 		if (buf[0] == '\n') continue;
 
@@ -88,6 +90,7 @@
 		else			// prefix line
 		{
 			strncpy(buffer, buf, 79);
+			buffer[79] = 0;
 
 	  		char *loc = NULL;		//PG4I, 26Jul2005
 	  		if ((loc = strchr(buffer, '\r')))
@@ -104,6 +107,9 @@
 buffer[i] = '\0';
 			}
 
+			if (j  4)
+continue;
+			
 			j = 4;
 
 			while (strcmp(buffer+j , ) != 0)