Re: [BUG] wrong treatment of subject headers with only one character

Urs Janßen <[email protected]> Sat, 10 Jan 2009 20:52:20 +0100
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
On Sat, Jan 10, 2009 at 08:29:47PM +0100, Dennis Preiser wrote:
> If the subject of a new article I write contains only one character or 
> one number, tin treat this subject as empty and refuses posting  
> (inews_prog set to --internal) or strips the subject header from the  
> article (inews_prog set to an external inews).
>
> This happens at least with tin-1.9.3 and the latest snapshot.
>
> Can anyone else reproduce this?

off by one in post.c:checknadd_headers(), the check should be > 2 instead
of > 3 as there is no \n in the string as the comment suggests.

=== modified file 'src/post.c'
--- src/post.c	2009-01-08 10:24:14 +0000
+++ src/post.c	2009-01-10 19:47:11 +0000
@@ -3980,7 +3980,7 @@
 		} else if ((ptr = parse_header(l, "Fcc", FALSE, FALSE))) {
 			fcc = my_strdup(ptr);
 		} else if ((ptr = strchr(l, ':')) != NULL) { /* valid header? */
-			if (strlen(ptr) > 3) /* skip empty headers ": \n\0" */
+			if (strlen(ptr) > 2) /* skip empty headers ": \0" */
 				fprintf(fp_out, "%s\n", l);
 		}
 	} /* end of headers */



urs
-- 
"Only whimps use tape backup: _real_ men just upload their important stuff
 on ftp, and let the rest of the world mirror it ;)" - Linus