From da574eb2bfd374041b4741bb92d8f4c833804729 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 15 May 2011 09:42:49 +0000 Subject: [PATCH] remove checking for thismodel->INPmodType --- ChangeLog | 5 +++++ src/spicelib/parser/inp2z.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1e2db96f0..b2a409b14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-05-15 Holger Vogt + * inp2z.c: remove checking for thismodel->INPmodType + because this might lead to segfault if the user supplies + a wrong ZXXXXX input + 2011-05-08 Robert Larice * src/frontend/shyu.c , * src/frontend/spiceif.c , diff --git a/src/spicelib/parser/inp2z.c b/src/spicelib/parser/inp2z.c index 8b53f7499..ac0d63de4 100644 --- a/src/spicelib/parser/inp2z.c +++ b/src/spicelib/parser/inp2z.c @@ -90,7 +90,9 @@ void INP2Z(CKTcircuit *ckt, INPtables * tab, card * current) IFC(bindNode, (ckt, fast, 2, node2)); IFC(bindNode, (ckt, fast, 3, node3)); PARSECALL((&line, ckt, type, fast, &leadval, &waslead, tab)); - if ( (waslead) && ( thismodel->INPmodType != INPtypelook("MES") ) ) { + /* use type - not thismodel->INPmodType as it might not exist! */ + /* FIXME: Why do we need checking for type here? */ + if ( (waslead) && ( type /*thismodel->INPmodType*/ != INPtypelook("MES") ) ) { ptemp.rValue = leadval; GCA(INPpName, ("area", &ptemp, ckt, type, fast)); }