projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e62e8c
)
JFFS2: Return an error for long filenames
author
Richard Purdie
<rpurdie@rpsys.net>
Tue, 18 Apr 2006 01:05:46 +0000
(
02:05
+0100)
committer
Richard Purdie
<richard@tim.rpsys.net>
Tue, 18 Apr 2006 01:05:46 +0000
(
02:05
+0100)
Return an error if a name is too long for JFFS2 rather than
corrupting data.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
fs/jffs2/dir.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/jffs2/dir.c
b/fs/jffs2/dir.c
index 8bc7a5018e4044be500c3e14bf73b974673c6646..f92840a3a52fdb6c11d1f569bc753658fd97af07 100644
(file)
--- a/
fs/jffs2/dir.c
+++ b/
fs/jffs2/dir.c
@@
-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);