OSDN Git Service
(root)
/
android-x86
/
external-ntfs-3g.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2efc3e
)
ntfslabel.c: Fix incorrect label buffer being NULL-terminated.
author
Erik Larsson
<mechie@users.sourceforge.net>
Mon, 8 Feb 2016 17:32:24 +0000
(18:32 +0100)
committer
Erik Larsson
<mechie@users.sourceforge.net>
Mon, 8 Feb 2016 17:32:24 +0000
(18:32 +0100)
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.
ntfsprogs/ntfslabel.c
patch
|
blob
|
history
diff --git
a/ntfsprogs/ntfslabel.c
b/ntfsprogs/ntfslabel.c
index
77a34f0
..
e2d36c8
100644
(file)
--- a/
ntfsprogs/ntfslabel.c
+++ b/
ntfsprogs/ntfslabel.c
@@
-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)