Commit 387edc76 by Bryce McKinlay Committed by Bryce McKinlay

* name-finder.cc (lookup): Ignore a null dli_fname from d

From-SVN: r45181
parent 51c4678a
2001-08-26 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* name-finder.cc (lookup): Ignore a null dli_fname from dladdr.
2001-08-23 Tom Tromey <tromey@redhat.com> 2001-08-23 Tom Tromey <tromey@redhat.com>
* java/lang/reflect/Field.java (toString): Use * java/lang/reflect/Field.java (toString): Use
......
...@@ -145,11 +145,13 @@ _Jv_name_finder::lookup (void *p) ...@@ -145,11 +145,13 @@ _Jv_name_finder::lookup (void *p)
if (dladdr (p, &dl_info)) if (dladdr (p, &dl_info))
{ {
strncpy (file_name, dl_info.dli_fname, sizeof file_name); if (dl_info.dli_fname)
strncpy (file_name, dl_info.dli_fname, sizeof file_name);
strncpy (method_name, dl_info.dli_sname, sizeof method_name); strncpy (method_name, dl_info.dli_sname, sizeof method_name);
/* Don't trust dladdr() if the address is from the main program. */ /* Don't trust dladdr() if the address is from the main program. */
if (_Jv_argv == NULL || strcmp (file_name, _Jv_argv[0]) != 0) if (dl_info.dli_fname != NULL
&& (_Jv_argv == NULL || strcmp (file_name, _Jv_argv[0]) != 0))
return true; return true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment