[Kde-pim] Review Request 127299: Safe wrapper around gpgmepp_strerror_r
Jan Kundrát
jkt at kde.org
Mon Mar 7 12:24:46 GMT 2016
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127299/
-----------------------------------------------------------
(Updated March 7, 2016, 12:24 p.m.)
Review request for KDEPIM-Libraries and Laurent Montel.
Changes
-------
v2: move that code to util.h
Repository: gpgmepp
Description
-------
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).
Diffs (updated)
-----
autotests/installtest.cpp 23c3b772496ec656f363e5bcc96c00414846173e
src/context.cpp ab633d7a07fc4bed7c3603f529cc9d1587557e12
src/editinteractor.cpp 0c5f778376326c77078e87fdc2ff55682af4d84b
src/exception.cpp c687024bbc0194d744c12794a8bededa7b4fd120
src/key.cpp 5eadbdd238012258f92f90fee7cafc6afa7f4427
src/util.h ed526e13f7969c1cfa679f1ec073a1258b774ac3
Diff: https://git.reviewboard.kde.org/r/127299/diff/
Testing
-------
It builds. There are no tests because all autotests are commented out, so...
Thanks,
Jan Kundrát
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list