udf: Return -ENOMEM when allocation fails in udf_get_filename()

Return -ENOMEM when allocation fails in udf_get_filename(). Update
udf_pc_to_char(), udf_readdir(), and udf_find_entry() to handle the
error appropriately. This allows us to pass appropriate error to
userspace instead of corrupting symlink contents by omitting some path
elements.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
Fabian Frederick
2015-04-08 21:23:51 +02:00
committed by Jan Kara
parent c0655fe9b0
commit 5ceb8b554d
4 changed files with 12 additions and 7 deletions

View File

@@ -168,7 +168,7 @@ static int udf_readdir(struct file *file, struct dir_context *ctx)
}
flen = udf_get_filename(sb, nameptr, lfi, fname, UDF_NAME_LEN);
if (!flen)
if (flen <= 0)
continue;
tloc = lelb_to_cpu(cfi.icb.extLocation);