This patch has reached me through the debian BTS. Comment by the submitter:
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.
Regards,
Joop PG4I
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.000000000 +0100
+++ tlf-0.9.25.patched/src/parse_logcfg.c 2005-12-17 02:21:33.000000000
+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.000000000 +0100
+++ tlf-0.9.25.patched/src/readctydata.c 2005-12-17 02:19:29.000000000
+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)
_______________________________________________
Tlf-devel mailing list
Tlf-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/tlf-devel