ntfslabel.c: Fix incorrect label buffer being NULL-terminated.

The UTF-16LE label buffer containing the result of mbs2ucs is the one
that should be NULL-terminated when the label is longer than permitted.
Not the input buffer, which is a function parameter assumed to be
NULL-terminated anyway.
pull/2/head
Erik Larsson 2016-02-08 18:32:24 +01:00
parent a2efc3ec9f
commit 0b378fd177
1 changed files with 1 additions and 1 deletions

View File

@ -389,7 +389,7 @@ static int change_label(ntfs_volume *vol, char *label)
(unsigned)(label_len -
(0x100 / sizeof(ntfschar))));
label_len = 0x100 / sizeof(ntfschar);
label[label_len] = 0;
new_label[label_len] = const_cpu_to_le16(0);
}
if(!opts.noaction)