hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/fs/udf/unicode.c
....@@ -177,7 +177,7 @@
177177 return 0;
178178 }
179179
180
- if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP))
180
+ if (UDF_SB(sb)->s_nls_map)
181181 conv_f = UDF_SB(sb)->s_nls_map->uni2char;
182182 else
183183 conv_f = NULL;
....@@ -247,7 +247,7 @@
247247 }
248248
249249 if (translate) {
250
- if (str_o_len <= 2 && str_o[0] == '.' &&
250
+ if (str_o_len > 0 && str_o_len <= 2 && str_o[0] == '.' &&
251251 (str_o_len == 1 || str_o[1] == '.'))
252252 needsCRC = 1;
253253 if (needsCRC) {
....@@ -285,7 +285,7 @@
285285 if (ocu_max_len <= 0)
286286 return 0;
287287
288
- if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP))
288
+ if (UDF_SB(sb)->s_nls_map)
289289 conv_f = UDF_SB(sb)->s_nls_map->char2uni;
290290 else
291291 conv_f = NULL;