]> wimlib.net Git - wimlib/blobdiff - src/ntfs-3g_capture.c
utf16le_dupz() input may be misaligned
[wimlib] / src / ntfs-3g_capture.c
index 6255f09a5ac6521efd002130224ca4776b4eba6e..22b9e55422497ae85e5a45a375863d6b806482f0 100644 (file)
@@ -40,6 +40,7 @@
 #include <ntfs-3g/security.h>
 #include <ntfs-3g/volume.h>
 
+#include "wimlib/assert.h"
 #include "wimlib/capture.h"
 #include "wimlib/dentry.h"
 #include "wimlib/encoding.h"
@@ -392,7 +393,7 @@ set_dentry_dos_name(struct wim_dentry *dentry, const struct dos_name_map *map)
        if (dentry->is_win32_name) {
                node = lookup_dos_name(map, dentry->d_inode->i_ino);
                if (node) {
-                       dentry->short_name = utf16le_dupz((const utf16lechar *)node->dos_name,
+                       dentry->short_name = utf16le_dupz(node->dos_name,
                                                          node->name_nbytes);
                        if (!dentry->short_name)
                                return WIMLIB_ERR_NOMEM;
@@ -429,7 +430,7 @@ struct readdir_ctx {
        size_t path_len;
        struct dos_name_map *dos_name_map;
        ntfs_volume *vol;
-       struct add_image_params *params;
+       struct capture_params *params;
        int ret;
 };
 
@@ -440,7 +441,7 @@ build_dentry_tree_ntfs_recursive(struct wim_dentry **root_p,
                                 size_t path_len,
                                 int name_type,
                                 ntfs_volume *ntfs_vol,
-                                struct add_image_params *params);
+                                struct capture_params *params);
 
 static int
 wim_ntfs_capture_filldir(void *dirent, const ntfschar *name,
@@ -527,7 +528,7 @@ build_dentry_tree_ntfs_recursive(struct wim_dentry **root_ret,
                                 size_t path_len,
                                 int name_type,
                                 ntfs_volume *vol,
-                                struct add_image_params *params)
+                                struct capture_params *params)
 {
        u32 attributes;
        int ret;
@@ -727,7 +728,7 @@ do_ntfs_umount(struct _ntfs_volume *vol)
 int
 build_dentry_tree_ntfs(struct wim_dentry **root_p,
                       const char *device,
-                      struct add_image_params *params)
+                      struct capture_params *params)
 {
        ntfs_volume *vol;
        ntfs_inode *root_ni;