From e9e0731be3e68feb9a1aacd1bdd973e09d6af017 Mon Sep 17 00:00:00 2001 From: Francois Donnet Date: Mon, 14 Jun 2004 17:31:45 +0000 Subject: [PATCH] protect NULL pointer --- alliance/src/boog/src/bog_map_adapt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/alliance/src/boog/src/bog_map_adapt.c b/alliance/src/boog/src/bog_map_adapt.c index 70cd9471..1e64b94d 100644 --- a/alliance/src/boog/src/bog_map_adapt.c +++ b/alliance/src/boog/src/bog_map_adapt.c @@ -176,6 +176,10 @@ static chain_list* loc_adapt_abl(chain_list* expr, float C) /*take the first value*/ for (port=cell->PORT; port; port=port->NEXT) if (port->C!=0) break; + if (!port) + { + return expr; + } for (abl=ABL_CDR(expr); abl; abl=ABL_CDR(abl)) { ABL_CAR(abl)=loc_adapt_abl(ABL_CAR(abl),port->C); } @@ -252,6 +256,10 @@ extern chain_list* adapt_abl(chain_list* expr) /*take the first value*/ for (port=cell->PORT; port; port=port->NEXT) if (port->C!=0) break; + if (!port) + { + return expr; + } for (abl=ABL_CDR(expr); abl; abl=ABL_CDR(abl)) { ABL_CAR(abl)=loc_adapt_abl(ABL_CAR(abl),port->C); }