🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #82713

Re: unrelated possible bug with C flag?

#82713
From: Julien ÉLIE
Date: Sun, 31 Jan 2010 09:49
67 lines
4457 bytes
Hi Dieter,

>> Then the (complete) patch is the following:
>
> Your patch is still wrong.  From the loop, variable "i" should be able to
> assume the value of zero if the data field of the "Followup-To:" header is
> empty or not specified.

Gosh!  I still do not understand at all your position on that subject.

When I suggest a patch that finds out 0 for "Followup-To:   ,  "
or  "Followup-To:   ,  , " you disagree because I should not check the
syntax and you tell me the article is bad and should not have been
injected.
So I changed the patch not to properly parse that syntax and find the
real number of newsgroups.

And now, you tell me that the patch is wrong and should find out 0 for
"Followup-To:     ", that is to say an EMPTY header field.

Yet, RFC 5536 explicitly states:

   o  Every line of a header field body (including the first and any
      that are subsequently folded) MUST contain at least one non-
      whitespace character.


So you *do* want to check the syntax here.



> Look at my solution.  It accounts for that possibility.

I do not understand why you want to explicitly account for that
possibility and not all the others.  You usually tell me the article
should not have been injected in the system and is bad...


Last but not least, if I look at your solution:

  if (HDR_FOUND(HDR__FOLLOWUPTO)) {
    for (i = 0, p = HDR(HDR__FOLLOWUPTO) ; p != NULL ; i++)
        p = strchr( ++p, ',');
  [...]

it does not work the way you say it works.
i++ is executed at the end of the expression so you will have i=1
for an empty header field body.

In fact, the code you suggest is exactly the same as the one we
already had except for the fact that it adds the possibility of
a read beyond our allocated memory (look at your ++p if *p is '\0'
for an empty header field -- the variable might be set to an empty
string if the header exists and is empty).

Note that I have not checked whether the variable can actually have
this "\0" value.  Maybe it is not set at all (NULL) so the code
would here be fine.  But it is better not to use ++p to prevent
the code from breaking in the future.

-- 
Julien ÉLIE

« Les mathématiques peuvent être définies comme une science
  dans laquelle on ne sait jamais de quoi on parle, ni si ce qu'on dit
  est vrai. » (Bertrand Russell) 
Technical Details
Message-ID: <hk3jns$rf1$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!weretis.net!feeder2.news.weretis.net!news.trigofacile.com!.POSTED.aaubervilliers-151-1-9-10.w83-114.abo.wanadoo.fr!not-for-mail
References: <hic74m$vi8$1@news.trigofacile.com> <hicf9f$ntj$1@snarked.org> <hiclo9$dd4$1@news.trigofacile.com> <hidmvp$vh1$1@snarked.org> <hitipd$rtb$1@news.trigofacile.com> <hiu2ar$707$1@snarked.org> <hiun2p$2mt$1@news.trigofacile.com> <hj0m9c$g98$1@snarked.org> <hj7qh0$ggu$1@news.trigofacile.com> <hj8csn$cok$1@snarked.org> <hjaiid$f7c$1@news.trigofacile.com> <hjar9t$mq$1@snarked.org> <hjnpm4$f5l$1@news.trigofacile.com> <hjq8r4$s5h$1@news.trigofacile.com> <hjqp78$iis$1@snarked.org> <hjsinn$cst$1@news.trigofacile.com> <hjsvgf$vko$1@snarked.org> <hjt1a2$u54$1@news.trigofacile.com> <hjt36j$1m8$2@snarked.org> <hjt45t$167$1@news.trigofacile.com> <hk002q$lni$1@snarked.org> <hk23qr$dok$1@news.trigofacile.com> <hk3cgr$662$1@snarked.org>

Show Full Headers
Complete Article Headers
Message-ID: <hk3jns$rf1$1@news.trigofacile.com>
Subject: Re: unrelated possible bug with C flag?
Date: Sun, 31 Jan 2010 10:49:49 +0100
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <hic74m$vi8$1@news.trigofacile.com> <hicf9f$ntj$1@snarked.org> <hiclo9$dd4$1@news.trigofacile.com> <hidmvp$vh1$1@snarked.org> <hitipd$rtb$1@news.trigofacile.com> <hiu2ar$707$1@snarked.org> <hiun2p$2mt$1@news.trigofacile.com> <hj0m9c$g98$1@snarked.org> <hj7qh0$ggu$1@news.trigofacile.com> <hj8csn$cok$1@snarked.org> <hjaiid$f7c$1@news.trigofacile.com> <hjar9t$mq$1@snarked.org> <hjnpm4$f5l$1@news.trigofacile.com> <hjq8r4$s5h$1@news.trigofacile.com> <hjqp78$iis$1@snarked.org> <hjsinn$cst$1@news.trigofacile.com> <hjsvgf$vko$1@snarked.org> <hjt1a2$u54$1@news.trigofacile.com> <hjt36j$1m8$2@snarked.org> <hjt45t$167$1@news.trigofacile.com> <hk002q$lni$1@snarked.org> <hk23qr$dok$1@news.trigofacile.com> <hk3cgr$662$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!weretis.net!feeder2.news.weretis.net!news.trigofacile.com!.POSTED.aaubervilliers-151-1-9-10.w83-114.abo.wanadoo.fr!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Lines: 67
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset="Windows-1252";
 reply-type=original
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 31 Jan 2010 09:49:48 +0000 (UTC)
Injection-Info: news.trigofacile.com;
 posting-host="aaubervilliers-151-1-9-10.w83-114.abo.wanadoo.fr:83.114.8.10";
 logging-data="28129"; mail-complaints-to="abuse@trigofacile.com"
In-Reply-To: <hk3cgr$662$1@snarked.org>
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6002.18005
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005