Bug 7404

Summary: Bad regexp (and logic) in MS::PerMsgStatus::get_content_preview
Product: Spamassassin Reporter: Mark Martinec <Mark.Martinec>
Component: LibrariesAssignee: SpamAssassin Developer Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: alexchorny, christophe.troestler, trond.endrestol, waltman
Priority: P2    
Version: 3.4.1   
Target Milestone: 3.4.2   
Hardware: PC   
OS: All   
Whiteboard:
Attachments: Fixes inappropriate regexp (and surrounding logic)

Description Mark Martinec 2017-04-11 18:30:26 UTC
t/autolearn.t ..................... Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^(.{ <-- HERE ,200}).*$/ at ../blib/lib/Mail/SpamAssassin/PerMsgStatus.pm line 923.

perl 5.25.11
Comment 1 Mark Martinec 2017-04-11 18:37:55 UTC
(sorry for hitting a submit prematurely on an unfinished PR)

Testing with 5.25.11 (soon to be be released as 5.26) fills the log
with warnings on a suspicious regexp, as shown above - an x{,n}
is not interpreted as x{0,n}, and even if it were, the logic is wrong
in that code.

fixing in trunk:
  Sending lib/Mail/SpamAssassin/PerMsgStatus.pm
Committed revision 1791010.
Comment 2 Mark Martinec 2017-04-11 18:39:25 UTC
Created attachment 5441 [details]
Fixes inappropriate regexp (and surrounding logic)
Comment 3 Mark Martinec 2017-04-11 18:56:48 UTC
3.4:
  Sending PerMsgStatus.pm
Committed revision 1791013.
Comment 4 Mark Martinec 2017-04-12 09:33:36 UTC
closing, resolved
Comment 5 Bill Cole 2017-07-05 02:26:05 UTC
*** Bug 7369 has been marked as a duplicate of this bug. ***
Comment 6 Bill Cole 2017-07-05 14:15:18 UTC
*** Bug 7444 has been marked as a duplicate of this bug. ***
Comment 7 Kevin A. McGrail 2017-08-09 21:02:05 UTC
*** Bug 7448 has been marked as a duplicate of this bug. ***
Comment 8 Bill Cole 2018-01-11 14:53:51 UTC
*** Bug 7480 has been marked as a duplicate of this bug. ***