]> wimlib.net Git - wimlib/commitdiff
Use REPARSE_POINT_MAX_SIZE macro
authorEric Biggers <ebiggers3@gmail.com>
Sun, 21 Apr 2013 23:48:13 +0000 (18:48 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 21 Apr 2013 23:48:13 +0000 (18:48 -0500)
src/ntfs-apply.c
src/symlink.c
src/wimlib_internal.h
src/win32.c

index b9f6bf299a640d965fdb1aee54a889b49836ba0c..f794b4a225358ab7796f00e2a030acd7b4dc7b5f 100644 (file)
@@ -362,7 +362,7 @@ apply_reparse_data(ntfs_inode *ni, struct wim_dentry *dentry,
 
        /* "Reparse point data, including the tag and optional GUID, cannot
         * exceed 16 kilobytes." - MSDN  */
 
        /* "Reparse point data, including the tag and optional GUID, cannot
         * exceed 16 kilobytes." - MSDN  */
-       if (wim_resource_size(lte) > (16 * 1024 - 8)) {
+       if (wim_resource_size(lte) > REPARSE_POINT_MAX_SIZE - 8) {
                ERROR("Reparse data of `%s' is too long (%"PRIu64" bytes)",
                      dentry->_full_path, wim_resource_size(lte));
                return WIMLIB_ERR_INVALID_DENTRY;
                ERROR("Reparse data of `%s' is too long (%"PRIu64" bytes)",
                      dentry->_full_path, wim_resource_size(lte));
                return WIMLIB_ERR_INVALID_DENTRY;
index 538b3e8548b1b5ec11fd3762349089a360d997f4..9eaf6b4b0e2f4457d6b084f9467b33e1fd78d0b4 100644 (file)
@@ -182,7 +182,7 @@ inode_readlink(const struct wim_inode *inode, char *buf, size_t buf_len,
        if (!lte)
                return -EIO;
 
        if (!lte)
                return -EIO;
 
-       if (wim_resource_size(lte) > 10000)
+       if (wim_resource_size(lte) > REPARSE_POINT_MAX_SIZE)
                return -EIO;
 
        u8 res_buf[wim_resource_size(lte)];
                return -EIO;
 
        u8 res_buf[wim_resource_size(lte)];
index 34d43fdc73080434f42d5b9eb10fcf3435774447..29c5ea6bf2f9284df8b6cf6269e673473795a3a7 100644 (file)
@@ -72,6 +72,8 @@ struct sd_set;
  * yet.  The differences between the versions are undocumented. */
 #define WIM_VERSION 0x10d00
 
  * yet.  The differences between the versions are undocumented. */
 #define WIM_VERSION 0x10d00
 
+#define REPARSE_POINT_MAX_SIZE (16 * 1024)
+
 /* Metadata for a resource in a WIM file. */
 struct resource_entry {
        /* Size, in bytes, of the resource in the WIM file. */
 /* Metadata for a resource in a WIM file. */
 struct resource_entry {
        /* Size, in bytes, of the resource in the WIM file. */
index 35026a56d258d38436dabb911a5ef30dc247fbaf..774222497627560bb8bb08a13023d60ac92552e3 100644 (file)
@@ -614,7 +614,7 @@ win32_capture_reparse_point(HANDLE hFile,
 
        /* "Reparse point data, including the tag and optional GUID,
         * cannot exceed 16 kilobytes." - MSDN  */
 
        /* "Reparse point data, including the tag and optional GUID,
         * cannot exceed 16 kilobytes." - MSDN  */
-       char reparse_point_buf[16 * 1024];
+       char reparse_point_buf[REPARSE_POINT_MAX_SIZE];
        DWORD bytesReturned;
 
        if (!DeviceIoControl(hFile, FSCTL_GET_REPARSE_POINT,
        DWORD bytesReturned;
 
        if (!DeviceIoControl(hFile, FSCTL_GET_REPARSE_POINT,