download_url() error checking fails to notice that the file wasnt correctly witten to disk
|Reported by:||dd32||Owned by:|
|Severity:||normal||Keywords:||has-patch needs-testing 3.3-early|
When upgrading/installing plugins, themes and WordPress download_url() is called to download the package to a temporary file.
At present, the return value of fwrite() is not checked, the result can be that the file is not written to disk correctly and subsequently, the Zip extraction fails.
This appears as if it can be caused by the user running out of disk space, as seen here: http://erisds.co.uk/wordpress/wordpress-automatic-upgrades-one-of-the-pitfalls
I'm attaching a patch which appears to fix it for me, however, As I do not have a setup where I can enforce a quota I cannot test the saving of the file without fudging the return value of fwrite() to something lower than expected.