summaryrefslogtreecommitdiffstats
path: root/fs/jffs2/compr_rtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/compr_rtime.c')
-rw-r--r--fs/jffs2/compr_rtime.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/jffs2/compr_rtime.c b/fs/jffs2/compr_rtime.c
index 406d9cc84ba8..79e771ab624f 100644
--- a/fs/jffs2/compr_rtime.c
+++ b/fs/jffs2/compr_rtime.c
@@ -37,6 +37,9 @@ static int jffs2_rtime_compress(unsigned char *data_in,
int outpos = 0;
int pos=0;
+ if (*dstlen <= 3)
+ return -1;
+
memset(positions,0,sizeof(positions));
while (pos < (*sourcelen) && outpos <= (*dstlen)-2) {