kasei / perl-iri

Perl implementation of Internationalized Resource Identifiers (IRIs)
0 stars 6 forks source link

IRI.pm: Must specify lower bound on regex quantifiers #8

Closed khwilliamson closed 8 years ago

khwilliamson commented 8 years ago

There are 5 occurrences of /{,\d}/ in this module. I suspect these were meant to mean {0,\d}, that is a quantifier matching 0 times up to the specified limit. But instead Perl thinks they are trying to match a left brace followed by a comma, followed by the digits, followed by a right brace. Perl 5.25 now warns about this usage, and so this was found.

It could be that I'm wrong and the code is meant to match that sequence, but it seems unlikely. And if I'm right, it indicates that there are tests missing that would have found this. (The same construct is used as well in Attean.)

kasei commented 8 years ago

Looks good. Thanks for catching this!

kasei commented 8 years ago

Can you point me to where you saw it in Attean? I didn't find anything with a quick grep.

khwilliamson commented 8 years ago

On 06/20/2016 05:37 PM, Gregory Todd Williams wrote:

Can you point me to where you saw it in Attean? I didn't find anything with a quick grep.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kasei/perl-iri/pull/8#issuecomment-227301350, or mute the thread https://github.com/notifications/unsubscribe/AAGhny2pcO0P23fGp2sgp7wAsChaQ_jNks5qNyRCgaJpZM4I6LsR.

Thanks for your prompt attention. I investigated, and it appears the errors are actually coming from IRI.

http://www.cpantesters.org/cpan/report/ee393738-362c-11e6-83b5-bcf7378fbd9d

BTW, this thread on p5p is how I found out about this: 87vb13u2le.fsf@k85.linux.bogus