Commit ce1fe248 authored by Ralf Becker's avatar Ralf Becker

ZP-726 Infinit loop if non-stream is given for an attachment. Released under...

ZP-726 Infinit loop if non-stream is given for an attachment. Released under the Affero GNU General Public License (AGPL) version 3.
need to check for a resource, as eg. feof("Error") === false and causing infinit loop in while!
parent ba460f57
......@@ -61,7 +61,8 @@ class GetAttachment extends RequestProcessor {
$stream = $attachment->data;
ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandleGetAttachment(): attachment stream from backend: %s", $stream));
if ($stream == null)
// need to check for a resource here, as eg. feof('Error') === false and causing infinit loop in while!
if (!is_resource($stream))
throw new StatusException(sprintf("HandleGetAttachment(): No stream resource returned by backend for attachment: %s", $attname), SYNC_ITEMOPERATIONSSTATUS_INVALIDATT);
header("Content-Type: application/octet-stream");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment