From b72d38369e9a0aa454407bbcf27d29257951dccb Mon Sep 17 00:00:00 2001 From: "mccabe%netscape.com" Date: Mon, 9 Aug 1999 09:34:22 +0000 Subject: [PATCH] Fix to 11451. Stop coredump on bad argument name in [iid_is(bogus)]; add != NULL safety check to loop. git-svn-id: svn://10.0.0.236/trunk@42745 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/typelib/xpidl/xpidl_typelib.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mozilla/xpcom/typelib/xpidl/xpidl_typelib.c b/mozilla/xpcom/typelib/xpidl/xpidl_typelib.c index 16546b68c5b..eacbb6217b6 100644 --- a/mozilla/xpcom/typelib/xpidl/xpidl_typelib.c +++ b/mozilla/xpcom/typelib/xpidl/xpidl_typelib.c @@ -619,8 +619,10 @@ handle_iid_is: if (iid_is) { int16 argnum = -1, count; IDL_tree params = IDL_OP_DCL(IDL_NODE_UP(IDL_NODE_UP(state->tree))).parameter_dcls; - for (count = 0; IDL_LIST(params).data; - params = IDL_LIST(params).next, count++) { + for (count = 0; + params != NULL && IDL_LIST(params).data != NULL; + params = IDL_LIST(params).next, count++) + { char *name; name = IDL_IDENT(IDL_PARAM_DCL(IDL_LIST(params).data).simple_declarator).str; if (!strcmp(name, iid_is)) { @@ -630,7 +632,7 @@ handle_iid_is: } } if (argnum < 0) { - IDL_tree_error(type, "can't find matching arg for " + IDL_tree_error(type, "can't find matching argument for " "[iid_is(%s)]\n", iid_is); return FALSE; }