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>2014-05-22 13:47:23 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-05-22 13:47:23 +0400
commit81f9ce0734bdadbf60006b5d228a16ab0c054055 (patch)
tree71262202d4d5591388ac4d1c47f2b71e9b486655 /winsup
parented2cfab440e844bdc5e14831ae2350df8c68d8a3 (diff)
* uinfo.cc (pwdgrp::fetch_account_from_windows): Fix potential SEGV
referencing NULL pointer.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/uinfo.cc8
2 files changed, 10 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b89f37467..c63871cfd 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,4 +1,9 @@
-2014-05-20 Corinna Vinschen <corinna@vinschen.de>
+2014-05-22 Corinna Vinschen <corinna@vinschen.de>
+
+ * uinfo.cc (pwdgrp::fetch_account_from_windows): Fix potential SEGV
+ referencing NULL pointer.
+
+2014-05-22 Corinna Vinschen <corinna@vinschen.de>
* libc/bsdlib.cc (forkpty): Close master and slave if fork fails to
avoid resource leak (CID 59997).
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 8f8f78cbc..409d0edbd 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -1441,17 +1441,17 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
else
{
/* Some trusted domain? */
- PDS_DOMAIN_TRUSTSW td = NULL;
+ PDS_DOMAIN_TRUSTSW td = NULL, this_td = NULL;
for (ULONG idx = 0; (td = cygheap->dom.trusted_domain (idx)); ++idx)
{
fetch_posix_offset (td, cldap);
if (td->PosixOffset > posix_offset && td->PosixOffset <= arg.id)
- posix_offset = td->PosixOffset;
+ posix_offset = (this_td = td)->PosixOffset;
}
- if (posix_offset)
+ if (this_td)
{
- cygpsid tsid (td->DomainSid);
+ cygpsid tsid (this_td->DomainSid);
PWCHAR s = tsid.pstring (sidstr);
__small_swprintf (s, L"-%u", arg.id - posix_offset);
}