Fix casefold filename fuzz test panic

Signed-off-by: nieben <nieben1@huawei.com>
This commit is contained in:
nieben 2024-08-19 16:18:09 +08:00
parent 099be2917a
commit 015a4b5ab3

View File

@ -479,10 +479,10 @@ f2fs_hash_t f2fs_dentry_hash(int encoding, int casefolded,
unsigned char *buff;
if (len && casefolded) {
buff = malloc(sizeof(char) * PATH_MAX);
buff = malloc(sizeof(char) * F2FS_NAME_LEN);
if (!buff)
return -ENOMEM;
dlen = table->ops->casefold(table, name, len, buff, PATH_MAX);
dlen = table->ops->casefold(table, name, len, buff, F2FS_NAME_LEN);
if (dlen < 0) {
free(buff);
goto opaque_seq;