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
parent
a2efc3ec9f
commit
0b378fd177
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue