lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1104 - in nss-pam-ldapd: common nslcd

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

nss-pam-ldapd commit: r1104 - in nss-pam-ldapd: common nslcd



Author: arthur
Date: Thu May 13 21:13:14 2010
New Revision: 1104
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1104

Log:
make logging of buffer checks consistent

Modified:
   nss-pam-ldapd/common/nslcd-prot.h
   nss-pam-ldapd/nslcd/common.h

Modified: nss-pam-ldapd/common/nslcd-prot.h
==============================================================================
--- nss-pam-ldapd/common/nslcd-prot.h   Thu May 13 18:31:52 2010        (r1103)
+++ nss-pam-ldapd/common/nslcd-prot.h   Thu May 13 21:13:14 2010        (r1104)
@@ -180,7 +180,8 @@
   if (((size_t)tmpint32)>=sizeof(buffer)) \
   { \
     /* will not fit */ \
-    DEBUG_PRINT("READ       : buffer error: %d bytes too 
large",(tmpint32-sizeof(buffer))+1); \
+    tmpint32=(tmpint32-sizeof(buffer))+1; \
+    DEBUG_PRINT("READ       : buffer %d bytes too small",tmpint32); \
     ERROR_OUT_BUFERROR(fp); \
   } \
   /* read string from the stream */ \
@@ -209,7 +210,8 @@
   if ((bufptr+(size_t)(sz))>buflen) \
   { \
     /* will not fit */ \
-    DEBUG_PRINT("READ       : buffer error: %d bytes too 
small",(bufptr+(sz)-(buflen))); \
+    tmpint32=bufptr+(sz)-(buflen); \
+    DEBUG_PRINT("READ       : buffer %d bytes too small",tmpint32); \
     ERROR_OUT_BUFERROR(fp); \
   }
 

Modified: nss-pam-ldapd/nslcd/common.h
==============================================================================
--- nss-pam-ldapd/nslcd/common.h        Thu May 13 18:31:52 2010        (r1103)
+++ nss-pam-ldapd/nslcd/common.h        Thu May 13 21:13:14 2010        (r1104)
@@ -46,7 +46,7 @@
   return -1;
 
 #define ERROR_OUT_BUFERROR(fp) \
-  log_log(LOG_WARNING,"client supplied argument too large"); \
+  log_log(LOG_WARNING,"client supplied argument %d bytes too large",tmpint32); 
\
   return -1;
 
 /* a simple wrapper around snprintf,
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits