[<prev] [next>] [day] [month] [year] [list]
Message-ID: <3151900.SLYxvDXFDr@blindfold>
Date: Mon, 21 Jan 2019 12:35:24 +0100
From: Richard Weinberger <richard@....at>
To: yang.yang29@....com.cn
Cc: richard.weinberger@...il.com, dwmw2@...radead.org,
wang.yi59@....com.cn, linux-mtd@...ts.infradead.org,
linux-kernel@...r.kernel.org, xue.zhihong@....com.cn
Subject: Re: [PATCH] jffs2: check dstlen for jffs2_zlib_compress()
Am Montag, 21. Januar 2019, 09:59:10 CET schrieb yang.yang29@....com.cn:
> Thanks for reply.
> But I think if (*dstlen < 2) is not good enough.
Not enough in terms of what?
My patch does what the commit message says, it fixes the out of bound access.
What do I miss?
> Because if the length of data_in is equals to 2, the length of output compressed data is also 2.
> So there's no meaning to do all the compress calculates.
>
> And I had do an experiment:
> If dstlen equals to 3, and data_in has 3 same bytes, the length of output compressed data will be 2.
> Which means compress is effective.
This is a different issue and a possible further optimization.
Thanks,
//richard
Powered by blists - more mailing lists