* PATCH: pws-19: parameters again
@ 1999-05-22 13:21 Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1999-05-22 13:21 UTC (permalink / raw)
To: Zsh hackers list
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 <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-05-22 13:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-22 13:21 PATCH: pws-19: parameters again Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).