# HG changeset patch # User Sebastien Jodogne # Date 1499250391 -7200 # Node ID 5465cab476cfbe77d28e7761573f84883f1c6455 # Parent e371519d4ac924c6515ff5bc1b223c0dfec84e9d Fix issue #45 (crash when providing a folder to "--config" command-line option) diff -r e371519d4ac9 -r 5465cab476cf NEWS --- a/NEWS Tue Jul 04 15:36:19 2017 +0000 +++ b/NEWS Wed Jul 05 12:26:31 2017 +0200 @@ -22,6 +22,7 @@ * Ability to retrieve raw frames encoded as unsigned 32-bits integers * Fix issue 35 (AET name is not transferred to Orthanc using DCMTK 3.6.0) * Fix issue 44 (Bad interpretation of photometric interpretation MONOCHROME1) +* Fix issue 45 (crash when providing a folder to "--config" command-line option) * Fix issue 49 (Worklists: accentuated characters are removed from C-Find responses) * Fix Debian #865606 (orthanc FTBFS with libdcmtk-dev 3.6.1~20170228-2) * Fix XSS inside DICOM in Orthanc Explorer (as reported by Victor Pasnkel, Morphus Labs) diff -r e371519d4ac9 -r 5465cab476cf OrthancServer/main.cpp --- a/OrthancServer/main.cpp Tue Jul 04 15:36:19 2017 +0000 +++ b/OrthancServer/main.cpp Wed Jul 05 12:26:31 2017 +0200 @@ -1207,8 +1207,17 @@ #endif std::string target = argument.substr(9); - SystemToolbox::WriteFile(configurationSample, target); - return 0; + + try + { + SystemToolbox::WriteFile(configurationSample, target); + return 0; + } + catch (OrthancException&) + { + LOG(ERROR) << "Cannot write sample configuration as file \"" << target << "\""; + return -1; + } } else {