Mercurial > hg > orthanc
changeset 5935:c4c0640577fb
fix leaking of strings related to the build environment
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 16 Dec 2024 18:35:09 +0100 |
parents | 8a500c0defbf |
children | 433e89edb3a0 |
files | OrthancFramework/Sources/DicomNetworking/Internals/DicomTls.cpp OrthancServer/Resources/PreventProtobufDirectoryLeaks.py |
diffstat | 2 files changed, 20 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomNetworking/Internals/DicomTls.cpp Mon Dec 16 17:53:44 2024 +0100 +++ b/OrthancFramework/Sources/DicomNetworking/Internals/DicomTls.cpp Mon Dec 16 18:35:09 2024 +0100 @@ -44,6 +44,16 @@ #endif +#if ORTHANC_ENABLE_PLUGINS == 1 +# if defined(__ORTHANC_FILE__) +// Prevents the system-wide DCMTK library from leaking the +// full path of this source file in "DCMTLS_ERROR()" +# undef __FILE__ +# define __FILE__ __ORTHANC_FILE__ +# endif +#endif + + namespace Orthanc { namespace Internals
--- a/OrthancServer/Resources/PreventProtobufDirectoryLeaks.py Mon Dec 16 17:53:44 2024 +0100 +++ b/OrthancServer/Resources/PreventProtobufDirectoryLeaks.py Mon Dec 16 18:35:09 2024 +0100 @@ -29,13 +29,21 @@ with open(sys.argv[1], 'r') as f: s = f.read() -s = s.replace('__FILE__', '__ORTHANC_FILE__') +if False: + # This was the version in Orthanc 1.12.4, doesn't seem to work anymore + s = s.replace('__FILE__', '__ORTHANC_FILE__') -s = """ + s = """ #if !defined(__ORTHANC_FILE__) # define __ORTHANC_FILE__ __FILE__ #endif """ + s +else: + # New version in Orthanc 1.12.5 + s = """ +#undef __FILE__ +#define __FILE__ __ORTHANC_FILE__ +""" + s with open(sys.argv[1], 'w') as f: f.write(s)