lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1911 - nss-pam-ldapd/nslcd

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

nss-pam-ldapd commit: r1911 - nss-pam-ldapd/nslcd



Author: arthur
Date: Sat Jan 12 23:32:24 2013
New Revision: 1911
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1911&view=revision

Log:
check result of set_tolist() to ensure that memory allocation problems are 
logged

Modified:
   nss-pam-ldapd/nslcd/cfg.c
   nss-pam-ldapd/nslcd/group.c
   nss-pam-ldapd/nslcd/passwd.c
   nss-pam-ldapd/nslcd/shadow.c

Modified: nss-pam-ldapd/nslcd/cfg.c
==============================================================================
--- nss-pam-ldapd/nslcd/cfg.c   Sat Jan 12 23:27:06 2013        (r1910)
+++ nss-pam-ldapd/nslcd/cfg.c   Sat Jan 12 23:32:24 2013        (r1911)
@@ -851,6 +851,11 @@
   /* check the variables used in the expression */
   set = expr_vars(cfg->pam_authz_searches[i], NULL);
   list = set_tolist(set);
+  if (list == NULL)
+  {
+    log_log(LOG_CRIT, "malloc() failed to allocate memory");
+    exit(EXIT_FAILURE);
+  }
   for (i = 0; list[i] != NULL; i++)
   {
     if ((strcmp(list[i], "username") != 0) &&

Modified: nss-pam-ldapd/nslcd/group.c
==============================================================================
--- nss-pam-ldapd/nslcd/group.c Sat Jan 12 23:27:06 2013        (r1910)
+++ nss-pam-ldapd/nslcd/group.c Sat Jan 12 23:32:24 2013        (r1911)
@@ -5,7 +5,7 @@
 
    Copyright (C) 1997-2006 Luke Howard
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -160,6 +160,11 @@
   attmap_add_attributes(set, attmap_group_gidNumber);
   attmap_add_attributes(set, attmap_group_member);
   group_attrs = set_tolist(set);
+  if (group_attrs == NULL)
+  {
+    log_log(LOG_CRIT, "malloc() failed to allocate memory");
+    exit(EXIT_FAILURE);
+  }
   set_free(set);
 }
 

Modified: nss-pam-ldapd/nslcd/passwd.c
==============================================================================
--- nss-pam-ldapd/nslcd/passwd.c        Sat Jan 12 23:27:06 2013        (r1910)
+++ nss-pam-ldapd/nslcd/passwd.c        Sat Jan 12 23:32:24 2013        (r1911)
@@ -5,7 +5,7 @@
 
    Copyright (C) 1997-2005 Luke Howard
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -147,6 +147,11 @@
   attmap_add_attributes(set, attmap_passwd_homeDirectory);
   attmap_add_attributes(set, attmap_passwd_loginShell);
   passwd_attrs = set_tolist(set);
+  if (passwd_attrs == NULL)
+  {
+    log_log(LOG_CRIT, "malloc() failed to allocate memory");
+    exit(EXIT_FAILURE);
+  }
   set_free(set);
 }
 

Modified: nss-pam-ldapd/nslcd/shadow.c
==============================================================================
--- nss-pam-ldapd/nslcd/shadow.c        Sat Jan 12 23:27:06 2013        (r1910)
+++ nss-pam-ldapd/nslcd/shadow.c        Sat Jan 12 23:32:24 2013        (r1911)
@@ -5,7 +5,7 @@
 
    Copyright (C) 1997-2005 Luke Howard
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -104,6 +104,11 @@
   attmap_add_attributes(set, attmap_shadow_shadowExpire);
   attmap_add_attributes(set, attmap_shadow_shadowFlag);
   shadow_attrs = set_tolist(set);
+  if (shadow_attrs == NULL)
+  {
+    log_log(LOG_CRIT, "malloc() failed to allocate memory");
+    exit(EXIT_FAILURE);
+  }
   set_free(set);
 }
 
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/