summaryrefslogtreecommitdiffhomepage
path: root/src/fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/ntapi_tt_istat.c5
-rw-r--r--src/fs/ntapi_tt_stat.c5
-rw-r--r--src/fs/ntapi_tt_statfs.c5
3 files changed, 12 insertions, 3 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;
diff --git a/src/fs/ntapi_tt_stat.c b/src/fs/ntapi_tt_stat.c
index 088adf6..e262296 100644
--- a/src/fs/ntapi_tt_stat.c
+++ b/src/fs/ntapi_tt_stat.c
@@ -25,6 +25,7 @@ int32_t __stdcall __ntapi_tt_stat(
nt_fai * fai;
wchar16_t * wch;
wchar16_t * wch_mark;
+ wchar16_t * wch_cap;
uint32_t hash;
uint32_t written;
@@ -116,7 +117,9 @@ int32_t __stdcall __ntapi_tt_stat(
hash = __DEVICE_PATH_PREFIX_HASH;
}
- for (; *wch!='\\'; )
+ wch_cap = sdev->buffer + (sdev->strlen / sizeof(wchar16_t));
+
+ for (; wch<wch_cap && *wch!='\\'; )
wch++;
stat->obj_name_strlen = sdev->strlen;
diff --git a/src/fs/ntapi_tt_statfs.c b/src/fs/ntapi_tt_statfs.c
index 0638a54..d740759 100644
--- a/src/fs/ntapi_tt_statfs.c
+++ b/src/fs/ntapi_tt_statfs.c
@@ -23,6 +23,7 @@ int32_t __stdcall __ntapi_tt_statfs(
nt_unicode_string * sdev;
wchar16_t * wch;
wchar16_t * wch_mark;
+ wchar16_t * wch_cap;
uint32_t offset;
uint32_t hash;
void * mnt_points_buffer;
@@ -157,7 +158,9 @@ int32_t __stdcall __ntapi_tt_statfs(
hash = __DEVICE_PATH_PREFIX_HASH;
}
- for (; *wch!='\\'; )
+ wch_cap = sdev->buffer + (sdev->strlen / sizeof(wchar16_t));
+
+ for (; wch<wch_cap && *wch!='\\'; )
wch++;
statfs->obj_name_strlen = sdev->strlen;