Skip to content

Commit

Permalink
JFFS2: Return an error for long filenames
Browse files Browse the repository at this point in the history
Return an error if a name is too long for JFFS2 rather than
corrupting data.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
  • Loading branch information
Richard Purdie authored and Richard Purdie committed Apr 18, 2006
1 parent 6e62e8c commit 373d5e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/jffs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target,

D1(printk(KERN_DEBUG "jffs2_lookup()\n"));

if (target->d_name.len > JFFS2_MAX_NAME_LEN)
return ERR_PTR(-ENAMETOOLONG);

dir_f = JFFS2_INODE_INFO(dir_i);
c = JFFS2_SB_INFO(dir_i->i_sb);

Expand Down

0 comments on commit 373d5e7

Please sign in to comment.