Safe wrapper around gpgmepp_strerror_r
The GpgME provides two functions, gpgme_strerror which is not thread
safe, and gpgme_strerror_r which is reentrant, but requires the caller
to provide preallocated memory. Their use in GpgME++ was not consistent,
and neither was the size of the used memory buffer or its sanitization
concerning the trailing null byte.
This is a C++ library, so let's use C++ facilities for this. At the same
time, C++11 is not required and therefore std::string::reserve is not
usable (strings might use segmented memory prior to C++11).
Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
REVIEW: 127299
parent
e2dd5db2
Please register or sign in to comment