[Kde-pim] Review Request 127299: Safe wrapper around gpgmepp_strerror_r

Jan Kundrát jkt at kde.org
Sun Mar 6 23:25:48 GMT 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127299/
-----------------------------------------------------------

Review request for KDEPIM-Libraries, Laurent Montel and Marc Mutz.


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
-----

  autotests/installtest.cpp 23c3b772496ec656f363e5bcc96c00414846173e 
  src/CMakeLists.txt 1c3335a5d2b006b5a7b6271bf83583b5548ff004 
  src/context.cpp ab633d7a07fc4bed7c3603f529cc9d1587557e12 
  src/editinteractor.cpp 0c5f778376326c77078e87fdc2ff55682af4d84b 
  src/exception.cpp c687024bbc0194d744c12794a8bededa7b4fd120 
  src/gpgmepp_strerror.h PRE-CREATION 
  src/gpgmepp_strerror.cpp PRE-CREATION 
  src/key.cpp 5eadbdd238012258f92f90fee7cafc6afa7f4427 

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