| Summary | Infinite loop feof() and fread() addAttachmentFromPart |
| Queue | IMP |
| Queue Version | 6.2.27 |
| Type | Bug |
| State | Unconfirmed |
| Priority | 2. Medium |
| Owners | |
| Requester | ssri_abo (at) u-paris2 (dot) fr |
| Created | 03/30/2022 (1304 days ago) |
| Due | |
| Updated | 02/19/2025 (247 days ago) |
| Assigned | |
| Resolved | |
| Github Issue Link | |
| Github Pull Request | |
| Milestone | |
| Patch | No |
New Attachment: imp-15101-infinite-loop.patch
The patch is for imp 6.2.27, but should also apply to FRAMEWORK_6 and master
As i am unable to reproduce the problem i could not tested this patch.
IMHO a solution would be to check if $stream is set before calling
rewind($stream);
$dest_handle = fopen($atc_file, 'w+b');
while (!feof($stream)) {
fwrite($dest_handle, fread($stream, 1024));
}
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Infinite loop feof() and fread() addAttachmentFromPart
Queue ⇒ IMP
Milestone ⇒
Patch ⇒ No
Horde 5.2.23
Horde log suddenly flooded by following PHP errors ( addAttachmentFromPart ) :
WARN: HORDE [imp] PHP ERROR: rewind() expects parameter 1 to be
resource, null given [pid 29928 on line 3167 of
"/usr/share/horde/imp/lib/Compose.php"]
WARN: HORDE [imp] PHP ERROR: feof() expects parameter 1 to be
resource, null given [pid 29928 on line 3169 of
"/usr/share/horde/imp/lib/Compose.php"]
WARN: HORDE [imp] PHP ERROR: fread() expects parameter 1 to be
resource, null given [pid 29928 on line 3170 of
"/usr/share/horde/imp/lib/Compose.php"]