https://bugs.openldap.org/show_bug.cgi?id=10050
Issue ID: 10050 Summary: Use of stack allocated string in mdb_strerror Product: LMDB Version: unspecified Hardware: All OS: Windows Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: liblmdb Assignee: bugs@openldap.org Reporter: es@m-labs.hk Target Milestone: ---
https://git.openldap.org/openldap/openldap/-/blob/mdb.master/libraries/liblm...
This piece of code exists from 2014, and these lines are not working outside of MSVC. Moreover, they lead to segfaults in MINGW compiled environments.
Please see the patch we use for potential fix: https://github.com/msys2/MINGW-packages/blob/31012dd33a32390d1e5f9b933887990...
https://bugs.openldap.org/show_bug.cgi?id=10050
--- Comment #1 from Howard Chu hyc@openldap.org --- Your patch is not thread-safe.
Which version of mingw / gcc did you use? Worked fine in mingw before; we never use MSVC.
https://bugs.openldap.org/show_bug.cgi?id=10050
--- Comment #2 from es@m-labs.hk --- I used GCC 13.
Well we do not use multithreading in our application, so for us this fix is fine. I would suggest that another way to fix this would be allocating strings and introduce new function to the API that would free the string in correct way.
Anyway, initial code is obviously not safe for use with any compiler.
https://bugs.openldap.org/show_bug.cgi?id=10050
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|needs_review |