]> git.pond.sub.org Git - empserver/commitdiff
Fix obj_changed() to check object exists
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 1 Jul 2012 08:00:35 +0000 (10:00 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 13 Jul 2012 18:15:33 +0000 (20:15 +0200)
Relatively harmless, because these kinds of objects don't go away.

src/lib/subs/check.c

index 74cefa9effd44ebb63a298ab9e8b52dd62fd2695..fd06354b45841f820fb3b3e6e36e5b8d7f956e58 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Steve McClure, 1998
- *     Markus Armbruster, 2004-2011
+ *     Markus Armbruster, 2004-2012
  */
 
 #include <config.h>
@@ -50,7 +50,8 @@ obj_changed(struct empobj *obj, size_t sz)
 {
     union empobj_storage old, tobj;
 
-    get_empobj(obj->ef_type, obj->uid, &old);
+    if (!get_empobj(obj->ef_type, obj->uid, &old))
+       return 0;
     memcpy(&tobj, obj, sz);
     old.gen.timestamp = tobj.gen.timestamp = 0;
     old.gen.generation = tobj.gen.generation = 0;