[Commit] nickle ChangeLog,1.123,1.124 hash.c,1.9,1.10

Keith Packard commit at keithp.com
Tue Mar 15 11:23:52 PST 2005


Committed by: keithp

Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv10650

Modified Files:
	ChangeLog hash.c 
Log Message:
2005-03-15  Keith Packard  <keithp at keithp.com>

	* hash.c: (HashGet):
	Check for NULL hash value in a valid hash element.  This
	occurs when a reference to a hash element is made and then
	not stored through.


Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/nickle/ChangeLog,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- ChangeLog	25 Feb 2005 03:23:06 -0000	1.123
+++ ChangeLog	15 Mar 2005 19:23:48 -0000	1.124
@@ -1,3 +1,10 @@
+2005-03-15  Keith Packard  <keithp at keithp.com>
+
+	* hash.c: (HashGet):
+	Check for NULL hash value in a valid hash element.  This
+	occurs when a reference to a hash element is made and then
+	not stored through.
+
 2005-02-24  Eric Anholt  <anholt at freedesktop.org>
 
 	reviewed by: Keith Packard

Index: hash.c
===================================================================
RCS file: /local/src/CVS/nickle/hash.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- hash.c	30 Nov 2004 19:51:16 -0000	1.9
+++ hash.c	15 Mar 2005 19:23:48 -0000	1.10
@@ -341,6 +341,7 @@
     HashTablePtr    ht = &hv->hash;
     Value	    hash = ValueHash (key);
     Value	    *he;
+    Value	    value;
 
     he = Find (ht, hash, key);
     if (!HashEltValid (he))
@@ -361,7 +362,14 @@
 	HashEltKey(he) = key;
 	HashEltValue(he) = Copy(ht->def);
     }
-    return HashEltValue (he);
+    value = HashEltValue (he);
+    if (!value)
+    {
+	RaiseStandardException (exception_uninitialized_value,
+				"uninitialized hash element", 0);
+	return (Void);
+    }
+    return value;
 }
 
 void




More information about the Commit mailing list