]> granicus.if.org Git - php/commit
Fix bug #65667: ftp_nb_continue produces segfault
authorPhilip Hofstetter <phofstetter@sensational.ch>
Wed, 2 Oct 2013 06:35:02 +0000 (08:35 +0200)
committerNikita Popov <nikic@php.net>
Fri, 4 Oct 2013 15:25:46 +0000 (17:25 +0200)
commit96cc419924c38874f9e2f2e5ccf3cd0430d90f43
treef882771e8ca08d6dde7789bbd0ff76721c255ac3
parent8973390541faaadfdfc0f838421f037060188e5e
Fix bug #65667: ftp_nb_continue produces segfault

the idea behind ftp_nb_get is for it to be followed by multiple calls
to ftp_nb_continue in order to download a file piece-by-piece.

As such, it's unwise to close the stream used to write the downloaded
data to when the file hasn't been completely downloaded within the first
call to ftp_nb_get.

This regression was added in a93a462dcefd62e07963dd2da506fbb3409c88b5
and this patch restores the behavior that was seen pre-patch.
NEWS
ext/ftp/php_ftp.c
ext/ftp/tests/ftp_nb_continue.phpt [new file with mode: 0644]
ext/ftp/tests/server.inc