mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Fix potential corruption when writing help file.
When the standalone version of a binary, with its help file included as a resource, extracts that resource to write it to a disk, it could have accidentally skipped a byte in the middle if the WriteFile call in this loop had not managed to write the whole file in one go. (cherry picked from commit 775d969ca86aa9e9d6d51bd0ee88af8b6369942a)
This commit is contained in:
parent
a02fd09854
commit
c3aba5d959
@ -118,7 +118,7 @@ static bool load_chm_resource(void)
|
|||||||
created = true;
|
created = true;
|
||||||
|
|
||||||
const uint8_t *p = (const uint8_t *)chm_resource;
|
const uint8_t *p = (const uint8_t *)chm_resource;
|
||||||
for (DWORD pos = 0; pos < chm_resource_size; pos++) {
|
for (DWORD pos = 0; pos < chm_resource_size ;) {
|
||||||
DWORD to_write = chm_resource_size - pos;
|
DWORD to_write = chm_resource_size - pos;
|
||||||
DWORD written = 0;
|
DWORD written = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user