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

[leafnode-list] Leafnode 2.0b8: XPAT causes segfault


XPAT with header not in overview is unusable:

stefan@xenon:~$ nc localhost nntp
200 Leafnode NNTP Daemon, version 2.0b8 running at xenon.eswe.dyndns.org
group local.test
211 1000 2 91756 local.test group selected
XPAT user-agent 91000-91756 s*
221 user-agent header matches (from article files) for postings 91000-91756:

In nntpd.c: doselectedheader(), lines 1553ff:

|             l = getheader( s, header );
| /*
|             STRIP_TRAILING_SPACE( l );
| */
|             if ( mp ) {
|                 ap = patterns;
|                 while ( ap ) {
|                     if ( !ngmatch( (const char*)&(ap->string), l ) )

ngmatch() doesn't like its arguments to be NULL. SIGSEGV.

The same bug makes XHDR output "(none)" lines for nonexisting articles.
Are those "(none)" lines necessary at all?

I've already mentioned that strings returned by [fm]?getheader() must
be freed.

fgetheader() doesn't strip linebreaks, messing up XHDR/XPAT output.

The STRIP_TRAILING_SPACE macro is unsafe. When applied to a string
containing only whitespace, it runs below the string's beginning.

The buffer used to hold the overview field in nntpd.c:1530:
                    strncpy( s, ++l, 1023 );
is too small. There /exist/ longer References, which get truncated.
<20001108.12142900@xxxxxxxxxxxxxxxxxxxxx> *g* has 1043 characters.

After the POST command, a line containing only "." isn't recognized
before an empty line has been input.


leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list