jffs2: Fix return code of rtime compress

The RTEMS and Linux JFFS2 compression support have a slightly different
interface.  This fixes a bug introduced by:

commit 17c3d536ca
Author: Yang Yang <yang.yang29@zte.com.cn>
Date:   Thu Jan 28 02:55:35 2021 -0800

    jffs2: check the validity of dstlen in jffs2_zlib_compress()

    KASAN reports a BUG when download file in jffs2 filesystem.It is
    because when dstlen == 1, cpage_out will write array out of bounds.
    Actually, data will not be compressed in jffs2_zlib_compress() if
    data's length less than 4.
This commit is contained in:
Sebastian Huber
2023-01-12 14:38:36 +01:00
parent 2271b69ac4
commit 2ea03be47c

View File

@@ -45,7 +45,7 @@ uint16_t rtems_jffs2_compressor_rtime_compress(
(void) self;
if (*dstlen <= 3)
return -1;
return JFFS2_COMPR_NONE;
memset(positions,0,sizeof(positions));