]> wimlib.net Git - wimlib/blobdiff - src/dentry.c
utf16le_dupz() input may be misaligned
[wimlib] / src / dentry.c
index 669b447ea8b88a9f4cd6cc2750809f97182816aa..862c6640c9bb54b9bef52610824604091b830e13 100644 (file)
@@ -1342,8 +1342,7 @@ read_dentry(const u8 * restrict buf, size_t buf_len,
        /* Read the filename if present.  Note: if the filename is empty, there
         * is no null terminator following it.  */
        if (file_name_nbytes) {
-               dentry->file_name = utf16le_dupz((const utf16lechar *)p,
-                                                file_name_nbytes);
+               dentry->file_name = utf16le_dupz(p, file_name_nbytes);
                if (dentry->file_name == NULL) {
                        ret = WIMLIB_ERR_NOMEM;
                        goto err_free_dentry;
@@ -1355,8 +1354,7 @@ read_dentry(const u8 * restrict buf, size_t buf_len,
        /* Read the short filename if present.  Note: if there is no short
         * filename, there is no null terminator following it. */
        if (short_name_nbytes) {
-               dentry->short_name = utf16le_dupz((const utf16lechar *)p,
-                                                 short_name_nbytes);
+               dentry->short_name = utf16le_dupz(p, short_name_nbytes);
                if (dentry->short_name == NULL) {
                        ret = WIMLIB_ERR_NOMEM;
                        goto err_free_dentry;