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

Dennis Preiser <[email protected]> Sat, 10 Jan 2009 21:20:37 +0100
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
On 10.01.2009, at 20:52, Urs Janßen wrote:

> On Sat, Jan 10, 2009 at 08:29:47PM +0100, Dennis Preiser wrote:
>> 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 */

This helps. Thanks,

Dennis