2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 02:49:00 +00:00

Fix Windows memory error (fixes #330)

This commit is contained in:
Jay Berkenbilt 2019-05-16 13:54:14 -04:00
parent a323f6f49f
commit b3f0dbff62
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2019-05-16 Jay Berkenbilt <ejb@ql.org>
* Fix memory error in Windows-only code from typo. Fixes #330.
2019-04-27 Jay Berkenbilt <ejb@ql.org>
* 8.4.1: release

View File

@ -371,7 +371,7 @@ QUtil::safe_fopen(char const* filename, char const* mode)
(static_cast<unsigned char>(u16.at(i)) << 8) +
static_cast<unsigned char>(u16.at(i+1)));
}
PointerHolder<wchar_t> wmodep(true, new wchar_t(strlen(mode) + 1));
PointerHolder<wchar_t> wmodep(true, new wchar_t[strlen(mode) + 1]);
wchar_t* wmode = wmodep.getPointer();
wmode[strlen(mode)] = 0;
for (size_t i = 0; i < strlen(mode); ++i)