[Pkg-shadow-commits] r2773 - in upstream/trunk: . lib
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Thu Apr 23 11:53:55 UTC 2009
Author: nekral-guest
Date: 2009-04-23 11:53:55 +0000 (Thu, 23 Apr 2009)
New Revision: 2773
Modified:
upstream/trunk/ChangeLog
upstream/trunk/lib/commonio.h
upstream/trunk/lib/gshadow.c
Log:
* lib/gshadow.c, lib/commonio.h: Added splint annotations.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2009-04-23 11:46:46 UTC (rev 2772)
+++ upstream/trunk/ChangeLog 2009-04-23 11:53:55 UTC (rev 2773)
@@ -1,5 +1,9 @@
2009-04-22 Nicolas François <nicolas.francois at centraliens.net>
+ * lib/gshadow.c, lib/commonio.h: Added splint annotations.
+
+2009-04-22 Nicolas François <nicolas.francois at centraliens.net>
+
* lib/get_gid.c: gidstr should not be NULL, but the check was
meant to make sure it is not empty.
* lib/get_uid.c: Likewise.
Modified: upstream/trunk/lib/commonio.h
===================================================================
--- upstream/trunk/lib/commonio.h 2009-04-23 11:46:46 UTC (rev 2772)
+++ upstream/trunk/lib/commonio.h 2009-04-23 11:53:55 UTC (rev 2773)
@@ -58,7 +58,7 @@
* Make a copy of the object (for example, struct passwd)
* and all strings pointed by it, in malloced memory.
*/
- void *(*dup) (const void *);
+ /*@null@*/ /*@only@*/void *(*dup) (const void *);
/*
* free() the object including any strings pointed by it.
@@ -87,7 +87,7 @@
* fgets and fputs (can be replaced by versions that
* understand line continuation conventions).
*/
- char *(*fgets) (char *, int, FILE *);
+ /*@null@*/char *(*fgets) (/*@returned@*/ /*@out@*/char *s, int n, FILE *stream);
int (*fputs) (const char *, FILE *);
/*
Modified: upstream/trunk/lib/gshadow.c
===================================================================
--- upstream/trunk/lib/gshadow.c 2009-04-23 11:46:46 UTC (rev 2772)
+++ upstream/trunk/lib/gshadow.c 2009-04-23 11:53:55 UTC (rev 2773)
@@ -40,11 +40,11 @@
#include <stdio.h>
#include "prototypes.h"
#include "defines.h"
-static FILE *shadow;
+static /*@null@*/FILE *shadow;
static char sgrbuf[BUFSIZ * 4];
-static char **members = NULL;
+static /*@null@*//*@only@*/char **members = NULL;
static size_t nmembers = 0;
-static char **admins = NULL;
+static /*@null@*//*@only@*/char **admins = NULL;
static size_t nadmins = 0;
static struct sgrp sgroup;
@@ -79,7 +79,7 @@
}
#endif
-static char **build_list (char *s, char **list[], size_t * nlist)
+static /*@null@*/char **build_list (char *s, char **list[], size_t * nlist)
{
char **ptr = *list;
size_t nelem = *nlist, size;
@@ -129,7 +129,7 @@
shadow = (FILE *) 0;
}
-struct sgrp *sgetsgent (const char *string)
+/*@observer@*//*@null@*/struct sgrp *sgetsgent (const char *string)
{
char *fields[FIELDS];
char *cp;
@@ -197,7 +197,7 @@
* converts it to a (struct sgrp). NULL is returned on EOF.
*/
-struct sgrp *fgetsgent (FILE * fp)
+/*@observer@*//*@null@*/struct sgrp *fgetsgent (/*@null@*/FILE * fp)
{
char buf[sizeof sgrbuf];
char *cp;
@@ -230,7 +230,7 @@
* getsgent - get a single shadow group entry
*/
-struct sgrp *getsgent (void)
+/*@observer@*//*@null@*/struct sgrp *getsgent (void)
{
#ifdef USE_NIS
bool nis_1_group = false;
@@ -329,7 +329,7 @@
* getsgnam - get a shadow group entry by name
*/
-struct sgrp *getsgnam (const char *name)
+/*@observer@*//*@null@*/struct sgrp *getsgnam (const char *name)
{
struct sgrp *sgrp;
@@ -452,7 +452,8 @@
strcpy (cp, sgrp->sg_adm[i]);
cp += strlen (cp);
}
- *cp++ = ':';
+ *cp = ':';
+ cp++;
/*
* Now do likewise with the group members.
More information about the Pkg-shadow-commits
mailing list