When writing compound file, the result is sometimes incorrect
- Dominant language
- C++
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
*Imported Issue originally submitted by a former Bitbucket user*
I am using the pole library to write and read outlook MSG files (to convert to/from mime). Until today it was good. But today I found the following: one of the attachment data stream has invalid "cluster" chain. When writing the file, all looks OK in debugger. But the resulting file is incorrect: far manager plugin refuses to open it; when I run my program against that file to convert to mime, it fails also: the problematic stream is attach_version1.0_#00000000/substg1.0_37010102 Its "correct" size is 24931929 bytes. When I read this stream into buffer, the byte count is only 11057664.
Additional info: streamIO::blocks.size() is 48696 when writing the stream. After the read it is 21597. I believe it should be the same 48696. That is why I think that the stream has invalid chain.
Please help me to debug the issue. I tried myself but it is too contrived.
*Note: This is a split zip archive. The `.z01.zip` extension has to be renamed to `.z01`, and `.z02.zip` to `.z02`. GitHub wouldn't otherwise accept it.*
[email8.zip](https://github.com/KubaO/pole/files/4692000/email8.zip)
[email8.z02.zip](https://github.com/KubaO/pole/files/4691997/email8.z02.zip)
[email8.z01.zip](https://github.com/KubaO/pole/files/4691995/email8.z01.zip)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the failure with the attached split archive after renaming the .z01.zip and .z02.zip extensions as described. Compare the attach_version1.0_#00000000/substg1.0_37010102 stream's expected 24931929-byte size and streamIO::blocks.size() value of 48696 with the values after reading; done means the resulting file opens and the stream reads completely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100