Skip to content

Commit 028f605

Browse files
committed
udf: Fix uninitialized array access for some pathnames
For filenames that begin with . and are between 2 and 5 characters long, UDF charset conversion code would read uninitialized memory in the output buffer. The only practical impact is that the name may be prepended a "unification hash" when it is not actually needed but still it is good to fix this. Reported-by: [email protected] Link: https://lore.kernel.org/all/[email protected] Signed-off-by: Jan Kara <[email protected]>
1 parent 404615d commit 028f605

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/udf/unicode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static int udf_name_from_CS0(struct super_block *sb,
243243
}
244244

245245
if (translate) {
246-
if (str_o_len <= 2 && str_o[0] == '.' &&
246+
if (str_o_len > 0 && str_o_len <= 2 && str_o[0] == '.' &&
247247
(str_o_len == 1 || str_o[1] == '.'))
248248
needsCRC = 1;
249249
if (needsCRC) {

0 commit comments

Comments
 (0)