plugins: fix error_string construction#2273
Conversation
c27c142 to
c5e0a51
Compare
sebsura
left a comment
There was a problem hiding this comment.
Looks good. Just added a small nit to think about.
c5e0a51 to
ff9fe57
Compare
|
If I interpret this correctly |
|
That is true, but as we do not check whether traceback or value are null before calling the function, we can still pass a null Looking into the cpython doc i get the following (for so this isnt fatal, but still not great. It looks like we should also be using |
|
Looks like github didnt show me your last commit, so now there is actually a check for that :) |
72f6bbf to
5d9109d
Compare
5d9109d to
fa62001
Compare
PyUnicode_AsUTF8 can return NULL and doing std::string(NULL) will crash. Fixes bareos#225: ce9f5bc introduces creation of std::string from potential nullptr
761d6f9 to
1fa6413
Compare
This PR fixes a bug introduced with commit ce9f5bc, see #225.
PyUnicode_AsUTF8 can return NULL and doing std::string(NULL) will crash.
With the changes of this PR we explicitly do a null-pointer check before constructing a std::string.
Fixes bareos/internal#225: ce9f5bc introduces creation of std::string from potential nullptr
Thank you for contributing to the Bareos Project!
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-toolto have some simple automated checks run and a proper changelog record added.General
Source code quality