lists.arthurdejong.org
RSS feed

nss-pam-ldapd branch master updated. 0.9.12-21-ga81bb35

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

nss-pam-ldapd branch master updated. 0.9.12-21-ga81bb35



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  a81bb35d6d1691b2f4ae1cd13bf7707d2ebb85c1 (commit)
      from  4a6c963dbb1a2c7ef78163dad570bc4b48181740 (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 -----------------------------------------------------------------
https://arthurdejong.org/git/nss-pam-ldapd/commit/?id=a81bb35d6d1691b2f4ae1cd13bf7707d2ebb85c1

commit a81bb35d6d1691b2f4ae1cd13bf7707d2ebb85c1
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Feb 9 14:38:03 2025 +0100

    Add extra safety check in attribute parsing
    
    This ensures that we never have a buffer underflow in attmap_get_value()
    even when expr_parse() would return unexpected values in the buffer.
    
    Closes https://github.com/arthurdejong/nss-pam-ldapd/issues/72

diff --git a/nslcd/attmap.c b/nslcd/attmap.c
index 5aad41f..fe7797b 100644
--- a/nslcd/attmap.c
+++ b/nslcd/attmap.c
@@ -2,7 +2,7 @@
    attmap.c - attribute mapping values and functions
    This file is part of the nss-pam-ldapd library.
 
-   Copyright (C) 2007-2014 Arthur de Jong
+   Copyright (C) 2007-2025 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
@@ -294,7 +294,7 @@ const char *attmap_get_value(MYLDAP_ENTRY *entry, const 
char *attr,
     return NULL;
   }
   /* strip trailing " */
-  if (buffer[strlen(buffer) - 1] == '"')
+  if ((strlen(buffer) > 0) && (buffer[strlen(buffer) - 1] == '"'))
     buffer[strlen(buffer) - 1] = '\0';
   return buffer;
 }

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

Summary of changes:
 nslcd/attmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
nss-pam-ldapd