From cde66fd87fb4091329575ca3ca749449ad9eb447 Mon Sep 17 00:00:00 2001 From: mazze Date: Fri, 25 Aug 2017 16:52:54 +0000 Subject: [PATCH] Scout: handle address NULL. This avoids a segfault when clicking on an entry with NULL address in the functions window. The reason for address NULL isn't known. It happened e.g. when displaying the functions off the battclock.resource. git-svn-id: https://svn.aros.org/svn/aros/trunk/contrib@54901 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- scout/source/classes/scout_functions.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scout/source/classes/scout_functions.c b/scout/source/classes/scout_functions.c index e13357d2c..e33ed00e1 100755 --- a/scout/source/classes/scout_functions.c +++ b/scout/source/classes/scout_functions.c @@ -215,10 +215,15 @@ STATIC IPTR mShowFunctions( struct IClass *cl, #ifdef __AROS__ fe->fe_Address = __AROS_GETVECADDR (lib, offset / LIB_VECTSIZE); - if (points2ram(fe->fe_Address)) { + if (fe->fe_Address) { + if (points2ram(fe->fe_Address)) { _snprintf(fe->fe_AddressStr, sizeof(fe->fe_AddressStr), MUIX_PH ADDRESS_FORMAT MUIX_PT, fe->fe_Address); - } else { + } else { _snprintf(fe->fe_AddressStr, sizeof(fe->fe_AddressStr), ADDRESS_FORMAT, fe->fe_Address); + } + } else { + fe->fe_Address = (APTR)-1; + stccpy(fe->fe_AddressStr, txtNoJump, sizeof(fe->fe_AddressStr)); } #else struct JumpEntry *je; -- 2.11.4.GIT