Home GnuPG
Diffusion GpgOL 1e699afd9531

Rewrite get_tmp_outfile to fix a crash

Description

Rewrite get_tmp_outfile to fix a crash

* src/common.cpp (get_tmp_outfile): Rewrite using c++.
(getTmpPathUtf8, CreateFileUtf8): New helpers.

This fixes a crash because somehow snwprintf didn't
always work as I expeted it to. In that case it would
only concatenate the first chars of the attachment filenames
this caused the wcsrchr of the backslash to return NULL and
the following wcschr to find the extension to crash.

This happend on a name conflict in the tmp folder. E.g.
if two mails were open with the same attachment filenames.

Details

Provenance
aheineckeAuthored on Jul 17 2018, 4:54 PM
Parents
rO1ff79faa4adb: Add wchar_to_utf8_string function
Branches
Unknown
Tags
Unknown