mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 18:14:24 +08:00
Fixed size truncation when checking for Interix types on 32-bit CPU
A cast, intended to avoid comparing signed to unsigned, led to truncate the size on a 32-bit CPU, hence to wrongly check for Interix types.
This commit is contained in:
parent
abba388447
commit
db35a16838
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 2005-2007 Yura Pakhuchiy
|
||||
* Copyright (c) 2005 Yuval Fledel
|
||||
* Copyright (c) 2006-2009 Szabolcs Szakacsits
|
||||
* Copyright (c) 2007-2012 Jean-Pierre Andre
|
||||
* Copyright (c) 2007-2013 Jean-Pierre Andre
|
||||
* Copyright (c) 2009 Erik Larsson
|
||||
*
|
||||
* This file is originated from the Linux-NTFS project.
|
||||
@ -683,9 +683,9 @@ static int ntfs_fuse_getstat(struct SECURITY_CONTEXT *scx,
|
||||
* Check whether it's Interix symbolic link, block or
|
||||
* character device.
|
||||
*/
|
||||
if ((size_t)na->data_size <= sizeof(INTX_FILE_TYPES)
|
||||
if ((u64)na->data_size <= sizeof(INTX_FILE_TYPES)
|
||||
+ sizeof(ntfschar) * PATH_MAX
|
||||
&& (size_t)na->data_size >
|
||||
&& (u64)na->data_size >
|
||||
sizeof(INTX_FILE_TYPES)) {
|
||||
INTX_FILE *intx_file;
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Copyright (c) 2005-2007 Yura Pakhuchiy
|
||||
* Copyright (c) 2005 Yuval Fledel
|
||||
* Copyright (c) 2006-2009 Szabolcs Szakacsits
|
||||
* Copyright (c) 2007-2012 Jean-Pierre Andre
|
||||
* Copyright (c) 2007-2013 Jean-Pierre Andre
|
||||
* Copyright (c) 2009 Erik Larsson
|
||||
*
|
||||
* This file is originated from the Linux-NTFS project.
|
||||
@ -792,9 +792,9 @@ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf)
|
||||
* Check whether it's Interix symbolic link, block or
|
||||
* character device.
|
||||
*/
|
||||
if ((size_t)na->data_size <= sizeof(INTX_FILE_TYPES)
|
||||
if ((u64)na->data_size <= sizeof(INTX_FILE_TYPES)
|
||||
+ sizeof(ntfschar) * PATH_MAX
|
||||
&& (size_t)na->data_size >
|
||||
&& (u64)na->data_size >
|
||||
sizeof(INTX_FILE_TYPES)
|
||||
&& !stream_name_len) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user