Skip Menu |

This queue is for tickets about the Net-SSH2 CPAN distribution.

Report information
The Basics
Id: 35922
Status: resolved
Priority: 0/
Queue: Net-SSH2

People
Owner: Nobody in particular
Requestors: rkitover [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.18
Fixed in: (no value)



read on an SFTP file is segfaulting on line 1562 of SSH2.xs fi->sf seems to be an invalid memory address. version of libssh2 is 0.18 Attached a simple test case. -- Rafael
Subject: segfault.t
#!/usr/bin/perl use strict; use warnings; use Net::SSH2; chomp(my $host = do { print "Enter SFTP host: "; scalar <> }); chomp(my $user = do { print "Enter SFTP user: "; scalar <> }); chomp(my $pass = do { print "Enter SFTP password: "; scalar <> }); chomp(my $path = do { print "Enter remote directory: "; scalar <> }); my $ssh = Net::SSH2->new; $ssh->connect($host); $ssh->auth_password($user, $pass); my $sftp = $ssh->sftp; my $dir = $sftp->opendir($path); while (my $file = $dir->read) { my $name = $file->{name}; next if $name =~ /^..?\z/; my $in = $sftp->open("$path/$name"); # This segfaults. $in->read(my $buf, 4096); }
Forgot to mention this only happens on perl 5.10, everything works fine on 5.8.8 -- Rafael
That is already fixed.