diff options
author | midipix <writeonce@midipix.org> | 2019-06-11 23:51:36 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-06-11 23:53:43 +0000 |
commit | 7bb8ac5bd6ed78105d214554713ba1e46e5ddd23 (patch) | |
tree | 5b60237c77d38e91df21511a5aa015c387ab594a /src/fs/ntapi_tt_istat.c | |
parent | 1039602ffac9d4585ceb739545c2c3a369100df6 (diff) | |
download | ntapi-7bb8ac5bd6.tar.bz2 ntapi-7bb8ac5bd6.tar.xz |
__ntapi_tt_{i}stat{fs}(): top-level UNC shares might not have a trailing slash.
Diffstat (limited to 'src/fs/ntapi_tt_istat.c')
-rw-r--r-- | src/fs/ntapi_tt_istat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fs/ntapi_tt_istat.c b/src/fs/ntapi_tt_istat.c index 51f1d43..18840fb 100644 --- a/src/fs/ntapi_tt_istat.c +++ b/src/fs/ntapi_tt_istat.c @@ -25,6 +25,7 @@ int32_t __stdcall __ntapi_tt_istat( nt_unicode_string * sdev; wchar16_t * wch; wchar16_t * wch_mark; + wchar16_t * wch_cap; uint32_t hash; uint32_t written; @@ -108,7 +109,9 @@ int32_t __stdcall __ntapi_tt_istat( hash = __DEVICE_PATH_PREFIX_HASH; } - for (; *wch!='\\'; ) + wch_cap = sdev->buffer + (sdev->strlen / sizeof(wchar16_t)); + + for (; wch<wch_cap && *wch!='\\'; ) wch++; istat->obj_name_strlen = sdev->strlen; |