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
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 6c532bc12..e2821db4b 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -726,8 +726,8 @@ handle_to_fn (HANDLE h, char *posix_fn)
memset (fnbuf, 0, sizeof (fnbuf));
ntfn = (OBJECT_NAME_INFORMATION *) fnbuf;
- ntfn->Name.MaximumLength = sizeof (fnbuf);
- ntfn->Name.Buffer = (WCHAR *) ntfn + 1;
+ ntfn->Name.MaximumLength = sizeof (fnbuf) - sizeof (*ntfn);
+ ntfn->Name.Buffer = (WCHAR *) (ntfn + 1);
DWORD res = NtQueryObject (h, ObjectNameInformation, ntfn, sizeof (fnbuf), NULL);