Permalink
Browse files

ZOOKEEPER-1439. c sdk: core in log_env for lack of checking the outpu…

…t argument *pwp* of getpwuid_r (Yubing Yin via michim)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1330769 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent cfecec8 commit 8101d10b6e5b112f5410663c2502bda182aa9572 @m1ch1 m1ch1 committed Apr 26, 2012
Showing with 4 additions and 1 deletion.
  1. +3 −0 CHANGES.txt
  2. +1 −1 src/c/src/zookeeper.c
View
@@ -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,
View
@@ -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>"));

0 comments on commit 8101d10

Please sign in to comment.