From 6fd617e3e1087374b10ae48d822bf23b9ba19e1b Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Tue, 16 Oct 2001 07:36:12 +0000 Subject: [PATCH] * name-finder.cc (_Jv_name_finder::lookup): Check for NULL dli_sname. From-SVN: r46280 --- libjava/ChangeLog | 4 ++++ libjava/name-finder.cc | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 860b81d88e3..c3364d05e78 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2001-10-16 Bryce McKinlay + + * name-finder.cc (_Jv_name_finder::lookup): Check for NULL dli_sname. + 2001-10-15 Bryce McKinlay * java/util/HashMap.java (HashEntry.clone): Removed. diff --git a/libjava/name-finder.cc b/libjava/name-finder.cc index 1533e0858d2..36726bd941a 100644 --- a/libjava/name-finder.cc +++ b/libjava/name-finder.cc @@ -147,10 +147,12 @@ _Jv_name_finder::lookup (void *p) { 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); + if (dl_info.dli_sname) + strncpy (method_name, dl_info.dli_sname, sizeof method_name); /* Don't trust dladdr() if the address is from the main program. */ if (dl_info.dli_fname != NULL + && dl_info.dli_sname != NULL && (_Jv_argv == NULL || strcmp (file_name, _Jv_argv[0]) != 0)) return true; }