Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2015-02-28 15:12:34 +0300
committerCorinna Vinschen <corinna@vinschen.de>2015-02-28 15:12:34 +0300
commit146200310f31ea493aaa0a8e258605dca51ac450 (patch)
treed3b5b5a702a7c8cc405e88b62b50e990429bd7fc /winsup
parentfab17cf9344c2decf21d34e4c9144f88223c389b (diff)
* uinfo.cc (pwdgrp::add_line): Return NULL if parsing a line failed.
(pwdgrp::add_account_post_fetch): Check return value from add_line and return NULL if add_line returns NULL.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/uinfo.cc15
2 files changed, 14 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 987e75803..cf1f9a9ca 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * uinfo.cc (pwdgrp::add_line): Return NULL if parsing a line failed.
+ (pwdgrp::add_account_post_fetch): Check return value from add_line and
+ return NULL if add_line returns NULL.
+
2015-02-27 Corinna Vinschen <corinna@vinschen.de>
* security.cc (alloc_sd): For directories, mark inherited ACEs
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index d9ce9028a..40e960a60 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -574,8 +574,9 @@ pwdgrp::add_line (char *eptr)
max_lines * pwdgrp_buf_elem_size);
}
lptr = eptr;
- if ((this->*parse) ())
- curr_lines++;
+ if (!(this->*parse) ())
+ return NULL;
+ curr_lines++;
}
return eptr;
}
@@ -1459,18 +1460,18 @@ get_logon_sid ()
void *
pwdgrp::add_account_post_fetch (char *line, bool lock)
{
+ void *ret = NULL;
+
if (line)
{
- void *ret;
if (lock)
pglock.init ("pglock")->acquire ();
- add_line (line);
- ret = ((char *) pwdgrp_buf) + (curr_lines - 1) * pwdgrp_buf_elem_size;
+ if (add_line (line))
+ ret = ((char *) pwdgrp_buf) + (curr_lines - 1) * pwdgrp_buf_elem_size;
if (lock)
pglock.release ();
- return ret;
}
- return NULL;
+ return ret;
}
void *