Henrique de Moraes Holschuh wrote:
> On Tue, 13 Jun 2006, Martin Schuster wrote:
>> 20-debian_defaults contains the line
>> qr'\{[0-9a-z]{4,}(-[0-9a-z]{4,}){0,7}\}?'i, # Windows Class ID ext. - CLSID)
>> which not only matches the intended CLSIDs, but also e.g.
>> {My Mailinglist} Hello world!
>> because of the question mark after the closing curly brace.
> 
> I cannot reproduce this here, amavisd-new 2.4.1 (same regexp).
> 
How did you try to reproduce this?
I found that error because of an email with an attachment with filename
{there was some text} - and some more text.ics
which got blocked.

Also, you can test this easily by calling
perl -ne 'print "ouch\n" if (/\{[0-9a-z]{4,}(-[0-9a-z]{4,}){0,7}\}?/i);'
and then type some filenames you want to test.

> Also, that last "?" will apply only to the preceding '}' character anyway.
> 
Which creates a problem, because in
{something foo bar}
^^^^^^^^^^ this part is enough to match, i.e. the regexp right now
works exactly as if it just was
\{[0-9a-z]{4,}
because the rest is
(...){0,7}\}?   which matches an empty string

You can verify this with the above perl-command, try to input
{Something
and it will print "ouch".

(without the question mark, it will still match
{SomeCharactersWithoutSpacesOrStuff}
which is also bad, now that I think about it...)

>> Another "bug" is the unmatched closing parenthesis in the comment,
>> but I don't think this deserves an own bug report :)
> 
> Well, I will fix this one :P
> 
Thanks :)

-- 
Martin Schuster  <[EMAIL PROTECTED]>
CenterPoint      http://www.centerpoint.eu.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to