From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13593 invoked from network); 22 May 1999 13:49:41 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 May 1999 13:49:41 -0000 Received: (qmail 20591 invoked by alias); 22 May 1999 13:49:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6331 Received: (qmail 20579 invoked from network); 22 May 1999 13:49:26 -0000 Message-Id: <9905221321.AA17394@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: PATCH: pws-19: parameters again Date: Sat, 22 May 1999 15:21:43 +0200 From: Peter Stephenson Playing around with modules again, I noticed that the setpm*s functions aren't protected against a call with a null hash table, which happens when they are unset. --- Src/Modules/parameter.c.us Thu May 20 09:28:28 1999 +++ Src/Modules/parameter.c Sat May 22 15:18:07 1999 @@ -207,6 +207,9 @@ int i; HashNode hn; + if (!ht) + return; + for (i = 0; i < ht->hsize; i++) for (hn = ht->nodes[i]; hn; hn = hn->next) { Cmdnam cn = zcalloc(sizeof(*cn)); @@ -375,6 +378,9 @@ int i; HashNode hn; + if (!ht) + return; + for (i = 0; i < ht->hsize; i++) for (hn = ht->nodes[i]; hn; hn = hn->next) { struct value v; @@ -504,6 +510,9 @@ { int i; HashNode hn; + + if (!ht) + return; for (i = 0; i < ht->hsize; i++) for (hn = ht->nodes[i]; hn; hn = hn->next) { -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy