diff --git a/libntfs/dir.c b/libntfs/dir.c index 3468500f..c6b562f1 100644 --- a/libntfs/dir.c +++ b/libntfs/dir.c @@ -522,7 +522,7 @@ ntfs_inode *ntfs_pathname_to_inode(ntfs_volume *vol, ntfs_inode *parent, p = ascii; /* Remove leading /'s. */ - while (p && *p && *p == PATH_SEP) + while (p && *p == PATH_SEP) p++; while (p && *p) { /* Find the end of the first token. */ diff --git a/libntfs/unistr.c b/libntfs/unistr.c index 8ed054e9..9f802674 100644 --- a/libntfs/unistr.c +++ b/libntfs/unistr.c @@ -727,7 +727,7 @@ ntfschar *ntfs_str2ucs(const char *s, int *len) ntfs_log_perror("Couldn't convert '%s' to Unicode", s); return NULL; } - if (*len > 0xff) { + if (*len > NTFS_MAX_NAME_LEN) { free(ucs); errno = ENAMETOOLONG; return NULL;