[Pkg-shadow-commits] r2794 - in upstream/trunk: . lib

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Fri Apr 24 23:26:31 UTC 2009


Author: nekral-guest
Date: 2009-04-24 23:26:31 +0000 (Fri, 24 Apr 2009)
New Revision: 2794

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/lib/groupio.c
Log:
	* lib/groupio.c: Updated splint annotations.
	* lib/groupio.c: Added assert to help splint.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-24 23:23:51 UTC (rev 2793)
+++ upstream/trunk/ChangeLog	2009-04-24 23:26:31 UTC (rev 2794)
@@ -1,5 +1,10 @@
 2009-04-25  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* lib/groupio.c: Updated splint annotations.
+	* lib/groupio.c: Added assert to help splint.
+
+2009-04-25  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/useradd.c: Check assumptions on snprintf().
 	* src/useradd.c: Replace peror by an strerror and avoid an
 	intermediate buffer.

Modified: upstream/trunk/lib/groupio.c
===================================================================
--- upstream/trunk/lib/groupio.c	2009-04-24 23:23:51 UTC (rev 2793)
+++ upstream/trunk/lib/groupio.c	2009-04-24 23:26:31 UTC (rev 2794)
@@ -44,7 +44,7 @@
 #include "groupio.h"
 
 static /*@null@*/struct commonio_entry *merge_group_entries (
-	/*@null@*/struct commonio_entry *gr1,
+	/*@null@*/ /*@returned@*/struct commonio_entry *gr1,
 	/*@null@*/struct commonio_entry *gr2);
 static int split_groups (unsigned int max_members);
 static int group_open_hook (void);
@@ -105,7 +105,7 @@
 	group_close_hook
 };
 
-static struct commonio_db group_db = {
+static /*@owned@*/struct commonio_db group_db = {
 	GROUP_FILE,		/* filename */
 	&group_ops,		/* ops */
 	NULL,			/* fp */
@@ -193,12 +193,12 @@
 	group_db.changed = true;
 }
 
-/*@null@*/struct commonio_entry *__gr_get_head (void)
+/*@dependent@*/ /*@null@*/struct commonio_entry *__gr_get_head (void)
 {
 	return group_db.head;
 }
 
-struct commonio_db *__gr_get_db (void)
+/*@observer@*/const struct commonio_db *__gr_get_db (void)
 {
 	return &group_db;
 }
@@ -265,9 +265,12 @@
 				if (NULL != gr2->next) {
 					gr2->next->prev = gr2->prev;
 				}
+				/* gr2 does not start with head */
+				assert (NULL != gr2->prev);
 				gr2->prev->next = gr2->next;
 			}
 		}
+		assert (NULL != gr1);
 	}
 
 	return 1;
@@ -286,7 +289,7 @@
  * set).
  */
 static /*@null@*/struct commonio_entry *merge_group_entries (
-	/*@null@*/struct commonio_entry *gr1,
+	/*@null@*/ /*@returned@*/struct commonio_entry *gr1,
 	/*@null@*/struct commonio_entry *gr2)
 {
 	struct group *gptr1;




More information about the Pkg-shadow-commits mailing list