diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-06-23 18:05:16 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-06-23 18:05:16 +0400 |
commit | f83cc3b7e9724276429d2f74705993eedacf0b43 (patch) | |
tree | 9a5aedac4d00c0905077c91df02d23c2dcd66579 | |
parent | 6950fc18e3676594fcfccae9dd470603692d26ef (diff) |
* mount.cc (fs_info::update): Define dir in the outermost scope to avoid
accessing out-of-scope value (CID 60027). Always initialize attr to
upath (CID 60113).
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/mount.cc | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 115b697d6..d12f6f855 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,11 @@ 2014-06-23 Corinna Vinschen <corinna@vinschen.de> + * mount.cc (fs_info::update): Define dir in the outermost scope to avoid + accessing out-of-scope value (CID 60027). Always initialize attr to + upath (CID 60113). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + * malloc_wrapper.cc (mallinfo): Initialize m if external malloc is used, too (CID 60120). diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc index 60ccdd505..eecd72692 100644 --- a/winsup/cygwin/mount.cc +++ b/winsup/cygwin/mount.cc @@ -177,17 +177,18 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol) FILE_FS_VOLUME_INFORMATION ffvi; WCHAR buf[NAME_MAX + 1]; } ffvi_buf; + UNICODE_STRING dir; UNICODE_STRING fsname; clear (); + /* Always caseinsensitive. We really just need access to the drive. */ + InitializeObjectAttributes (&attr, upath, OBJ_CASE_INSENSITIVE, NULL, + NULL); if (in_vol) vol = in_vol; else { ULONG access = READ_CONTROL; - /* Always caseinsensitive. We really just need access to the drive. */ - InitializeObjectAttributes (&attr, upath, OBJ_CASE_INSENSITIVE, NULL, - NULL); /* Note: Don't use the FILE_OPEN_REPARSE_POINT flag here. The reason is that symlink_info::check relies on being able to open a handle to the target of a volume mount point. */ @@ -205,7 +206,6 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol) && (attr.ObjectName->Length > 7 * sizeof (WCHAR) || status == STATUS_NO_MEDIA_IN_DEVICE)) { - UNICODE_STRING dir; RtlSplitUnicodePath (attr.ObjectName, &dir, NULL); attr.ObjectName = &dir; if (status == STATUS_NO_MEDIA_IN_DEVICE) |