lists.arthurdejong.org
RSS feed

nss-pam-ldapd branch master updated. 0.9.5-6-gd217632

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd branch master updated. 0.9.5-6-gd217632



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "nss-pam-ldapd".

The branch, master has been updated
       via  d217632fe007d98875c4ff20fe9fd4cac428c6d0 (commit)
      from  3add5f0b123e2877ee3b341c26fcfab9b56026fc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=d217632fe007d98875c4ff20fe9fd4cac428c6d0

commit d217632fe007d98875c4ff20fe9fd4cac428c6d0
Author: Geoffrey McRae <gnif@xbmc.org>
Date:   Thu Jun 11 21:51:59 2015 +1000

    Fixed signed 32bit overflow bug on 32bit systems

diff --git a/nslcd/common.c b/nslcd/common.c
index 979be82..9b3a3f9 100644
--- a/nslcd/common.c
+++ b/nslcd/common.c
@@ -282,7 +282,7 @@ char *sid2search(const char *sid)
   const char *tmpsid = sid;
   char *res, *tmp;
   int i = 0;
-  long int l;
+  unsigned long int l;
   /* check the beginning of the string */
   if (strncasecmp(sid, "S-", 2) != 0)
   {
@@ -304,20 +304,24 @@ char *sid2search(const char *sid)
     exit(1);
   }
   /* build the first part */
-  l = strtol(sid + 2, &tmp, 10);
-  sprintf(res, "\\%02x\\%02x", (int)l & 0xff, (int)i);
+  l = strtoul(sid + 2, &tmp, 10);
+  sprintf(res, "\\%02x\\%02x", (unsigned int)l & 0xff, (unsigned int)i);
   /* build authority part (we only handle 32 of the 48 bits) */
-  l = strtol(tmp + 1, &tmp, 10);
+  l = strtoul(tmp + 1, &tmp, 10);
   sprintf(res + strlen(res), "\\00\\00\\%02x\\%02x\\%02x\\%02x",
-          (int)((l >> 24) & 0xff), (int)((l >> 16) & 0xff),
-          (int)((l >> 8) & 0xff), (int)(l & 0xff));
+          (unsigned int)((l >> 24) & 0xff),
+          (unsigned int)((l >> 16) & 0xff),
+          (unsigned int)((l >> 8) & 0xff),
+          (unsigned int)(l & 0xff));
   /* go over the rest of the bits */
   while (*tmp != '\0')
   {
-    l = strtol(tmp + 1, &tmp, 10);
+    l = strtoul(tmp + 1, &tmp, 10);
     sprintf(res + strlen(res), "\\%02x\\%02x\\%02x\\%02x",
-            (int)(l & 0xff), (int)((l >> 8) & 0xff), (int)((l >> 16) & 0xff),
-            (int)((l >> 24) & 0xff));
+            (unsigned int)(l & 0xff),
+            (unsigned int)((l >> 8) & 0xff),
+            (unsigned int)((l >> 16) & 0xff),
+            (unsigned int)((l >> 24) & 0xff));
   }
   return res;
 }
@@ -327,11 +331,11 @@ long int binsid2id(const char *binsid)
 {
   int i;
   /* find the position of the last security id */
-  i = 2 + 6 + ((((int)binsid[1]) & 0xff) - 1) * 4;
-  return (((long int)binsid[i]) & 0xff) |
-         ((((long int)binsid[i + 1]) & 0xff) << 8) |
-         ((((long int)binsid[i + 2]) & 0xff) << 16) |
-         ((((long int)binsid[i + 3]) & 0xff) << 24);
+  i = 2 + 6 + ((((unsigned int)binsid[1]) & 0xff) - 1) * 4;
+  return (((unsigned long int)binsid[i]) & 0xff) |
+         ((((unsigned long int)binsid[i + 1]) & 0xff) << 8) |
+         ((((unsigned long int)binsid[i + 2]) & 0xff) << 16) |
+         ((((unsigned long int)binsid[i + 3]) & 0xff) << 24);
 }
 
 #ifdef WANT_STRTOUI

-----------------------------------------------------------------------

Summary of changes:
 nslcd/common.c |   32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
nss-pam-ldapd
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/