diff --git a/fs/udf/unicode.c b/fs/udf/unicode.c index 61a1738895b7..ad04dc227833 100644 --- a/fs/udf/unicode.c +++ b/fs/udf/unicode.c @@ -268,7 +268,7 @@ static int udf_name_from_CS0(uint8_t *str_o, int str_max_len, } if (translate) { - if (str_o_len <= 2 && str_o[0] == '.' && + if (str_o_len > 0 && str_o_len <= 2 && str_o[0] == '.' && (str_o_len == 1 || str_o[1] == '.')) needsCRC = 1; if (needsCRC) {