From 0c6159650d33f291846b3cddeb7fc79b609f86c2 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Thu, 23 Apr 2009 11:46:06 +0000 Subject: [PATCH] * 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. --- ChangeLog | 12 ++++++++++++ lib/get_gid.c | 2 +- lib/get_uid.c | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b160ec0..24334a5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-04-22 Nicolas François + + * 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. + +2009-04-22 Nicolas François + + * lib/getdef.c: Added splint annotations. + * lib/getdef.c: Ignore fputs() return value. + * lib/getdef.c: Use EXIT_FAILURE / EXIT_SUCCESS for exit() + 2009-04-22 Nicolas François * src/faillog.c: Added splint annotations. diff --git a/lib/get_gid.c b/lib/get_gid.c index c8962588..d13b95ad 100644 --- a/lib/get_gid.c +++ b/lib/get_gid.c @@ -41,7 +41,7 @@ int get_gid (const char *gidstr, gid_t *gid) errno = 0; val = strtoll (gidstr, &endptr, 10); - if ( ('\0' == gidstr) + if ( ('\0' == *gidstr) || ('\0' != *endptr) || (ERANGE == errno) || (val != (gid_t)val)) { diff --git a/lib/get_uid.c b/lib/get_uid.c index 92a09cae..dd90bad3 100644 --- a/lib/get_uid.c +++ b/lib/get_uid.c @@ -41,7 +41,7 @@ int get_uid (const char *uidstr, uid_t *uid) errno = 0; val = strtoll (uidstr, &endptr, 10); - if ( ('\0' == uidstr) + if ( ('\0' == *uidstr) || ('\0' != *endptr) || (ERANGE == errno) || (val != (uid_t)val)) { -- 2.40.0