kern/51798: sys/fs/ntfs/ntfs_subr.c ntfs_uastricmp() bug?

Ryuichiro Imura imura at
Mon May 5 08:30:14 PDT 2003

>Number:         51798
>Category:       kern
>Synopsis:       sys/fs/ntfs/ntfs_subr.c ntfs_uastricmp() bug?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 05 08:30:12 PDT 2003
>Originator:     Ryuichiro Imura
>Release:        FreeBSD 4.7-STABLE i386
System: FreeBSD 4.7-STABLE FreeBSD 4.7-STABLE #5: Mon Jan 13 22:18:39 JST 2003 root at vrs:/usr/obj/usr/src/sys/U1 i386


ntfs_uastricmp() in src/sys/ntfs/ntfs_subr.c is curious.
I think it should compare unicode and ascii string case insens,
but it compares ascii string which converted from unicode string
and unicode string which converted from ascii string.
ntfs_uastrcmp() (difference from ntfs_uastricmp() is just case
sens or insens) looks fine.

Above paragraph may not hit you, so please look at the code.
If I'm wrong, just close this PR.



Index: ntfs_subr.c
RCS file: /home/ncvs/src/sys/fs/ntfs/ntfs_subr.c,v
retrieving revision 1.29
diff -u -r1.29 ntfs_subr.c
--- ntfs_subr.c	4 Mar 2003 00:04:42 -0000	1.29
+++ ntfs_subr.c	5 May 2003 15:09:46 -0000
@@ -674,7 +674,7 @@
 	for (i = 0; i < ustrlen && i < astrlen; i++) {
 		res = ((int) NTFS_TOUPPER(NTFS_82U(NTFS_U28(ustr[i])))) -
-			((int)NTFS_TOUPPER(NTFS_82U(astr[i])));
+			((int)NTFS_TOUPPER(astr[i]));
 		if (res)
 			return res;


More information about the freebsd-bugs mailing list