zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mic...@apache.org
Subject svn commit: r1330769 - in /zookeeper/trunk: CHANGES.txt src/c/src/zookeeper.c
Date Thu, 26 Apr 2012 10:57:05 GMT
Author: michim
Date: Thu Apr 26 10:57:05 2012
New Revision: 1330769

URL: http://svn.apache.org/viewvc?rev=1330769&view=rev
Log:
ZOOKEEPER-1439. c sdk: core in log_env for lack of checking the output argument *pwp* of getpwuid_r
(Yubing Yin via michim)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/c/src/zookeeper.c

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1330769&r1=1330768&r2=1330769&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Thu Apr 26 10:57:05 2012
@@ -169,6 +169,9 @@ BUGFIXES:
 
   ZOOKEEPER-1395. node-watcher double-free redux (Mike Lundy via henryr)
    
+  ZOOKEEPER-1439. c sdk: core in log_env for lack of checking the output
+  argument *pwp* of getpwuid_r (Yubing Yin via michim)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

Modified: zookeeper/trunk/src/c/src/zookeeper.c
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/c/src/zookeeper.c?rev=1330769&r1=1330768&r2=1330769&view=diff
==============================================================================
--- zookeeper/trunk/src/c/src/zookeeper.c (original)
+++ zookeeper/trunk/src/c/src/zookeeper.c Thu Apr 26 10:57:05 2012
@@ -739,7 +739,7 @@ static void log_env() {
 
 #if defined(HAVE_GETUID) && defined(HAVE_GETPWUID_R)
   uid = getuid();
-  if (!getpwuid_r(uid, &pw, buf, sizeof(buf), &pwp)) {
+  if (!getpwuid_r(uid, &pw, buf, sizeof(buf), &pwp) && pwp) {
     LOG_INFO(("Client environment:user.home=%s", pw.pw_dir));
   } else {
     LOG_INFO(("Client environment:user.home=<NA>"));



Mime
View raw message