From 2ec58445cac6152a652024372d367fc23d4770da Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 12 Oct 2004 06:07:55 +0000 Subject: r2931: use next_codepoint() to ensure we properly handle multi-byte characters in pvfs_unix_path() (This used to be commit 0acf95d84c51d564f7215d34364c37ca74a2a150) --- source4/ntvfs/posix/pvfs_resolve.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/posix/pvfs_resolve.c') diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c index 01f6b13ec2..205e1e283f 100644 --- a/source4/ntvfs/posix/pvfs_resolve.c +++ b/source4/ntvfs/posix/pvfs_resolve.c @@ -217,8 +217,10 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, /* now do an in-place conversion of '\' to '/', checking for legal characters */ - for (;*p;p++) { - switch (*p) { + while (*p) { + size_t c_size; + codepoint_t c = next_codepoint(p, &c_size); + switch (c) { case '\\': if (name->has_wildcard) { /* wildcards are only allowed in the last part @@ -251,6 +253,8 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, case '|': return NT_STATUS_ILLEGAL_CHARACTER; } + + p += c_size; } name->full_name = ret; -- cgit