Mercurial > octave
changeset 26488:72e0a106d956 stable
__magick_read__.cc: Fix static analyzer detected issues (bug #55347).
* __magick_read__.cc (maybe_initialize_magick): Check "locale" C string is not
null before using it in constructor of C++ string.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 07 Jan 2019 15:49:30 -0800 |
parents | 6aa84dc27d01 |
children | 8f425e6ea110 |
files | libinterp/corefcn/__magick_read__.cc |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/__magick_read__.cc Mon Jan 07 15:26:57 2019 -0800 +++ b/libinterp/corefcn/__magick_read__.cc Mon Jan 07 15:49:30 2019 -0800 @@ -769,7 +769,7 @@ // Save locale as GraphicsMagick might change this (fixed in // GraphicsMagick since version 1.3.13 released on December 24, 2011) const char *static_locale = setlocale (LC_ALL, nullptr); - const std::string locale (static_locale); + const std::string locale = (static_locale ? static_locale : ""); const std::string program_name = octave::sys::env::get_program_invocation_name ();