develooper Front page | perl.perl5.porters | Postings from August 2012

[perl #114458] NET::Cmd incorrectly parsing new lines

From:
James E Keenan via RT
Date:
August 12, 2012 06:35
Subject:
[perl #114458] NET::Cmd incorrectly parsing new lines
Message ID:
rt-3.6.HEAD-11172-1344778497-1535.114458-15-0@perl.org
On Sun Aug 12 02:18:21 2012, cknipe wrote:
> 
> This is a bug report for perl from savage@savage.za.org,
> generated with the help of perlbug 1.39 running under perl 5.14.2.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> Net::Cmd incorrectly detects and breaks new lines.  RFC3977 (NNTP)
>    states that all lines should be
> terminated with a \r\n characters.  Net::Cmd searches for any
>    occurance of \r\n or \n and replaces
> the line breaks with an \n only.  In addition \r\n or \n characters
>    matches inside binary
> attachments to NNTP articles causing the attachments to become
>    corrupt.
> 
> The offending code SEEMS to be arround line 300:
>       substr($buf, 0, 0) = $partial;    ## prepend from last sysread
>       my @buf = split(/\015?\012/, $buf, -1);    ## break into lines
>       $partial = pop @buf;
>       push(@{${*$cmd}{'net_cmd_lines'}}, map {"$_\n"} @buf);
> 
> 
> 

Net::Cmd is part of the 'libnet' distribution, which is maintained on
CPAN.  Accordingly, I have forwarded this bug report to that
distribution's bug queue at rt.cpan.org.

Please refer to:
https://rt.cpan.org/Ticket/Display.html?id=78922

Thank you very much.
Jim Keenan

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=114458



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About