changeset 25206:cbe53b5ea5ce stable

check success of loading oct-file (bug #52977) * oct-parse.in.yy (load_fcn_from_file): Ensure function returned from load_oct is valid before using it.
author Olaf Till <i7tiol@t-online.de>
date Tue, 06 Feb 2018 07:00:09 +0100
parents 72ea868ca63a
children 2815f3257c9a a5ad9c053e41
files libinterp/parse-tree/oct-parse.in.yy
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy	Wed Apr 11 00:07:06 2018 -0400
+++ b/libinterp/parse-tree/oct-parse.in.yy	Tue Feb 06 07:00:09 2018 +0100
@@ -4753,9 +4753,11 @@
         octave_function *tmpfcn
           = dyn_loader.load_oct (nm, file, relative_lookup);
 
-        tmpfcn->stash_package_name (package_name);
-
-        retval = octave_value (tmpfcn);
+        if (tmpfcn)
+          {
+            tmpfcn->stash_package_name (package_name);
+            retval = octave_value (tmpfcn);
+          }
       }
     else if (len > 4 && file.substr (len-4, len-1) == ".mex")
       {