[OE-core] [PATCH 1/4] libarchive: fix CVE-2013-0211

Hongxu Jia hongxu.jia at windriver.com
Tue Apr 1 07:40:23 UTC 2014


On 04/01/2014 01:30 PM, Khem Raj wrote:
> On Fri, Mar 28, 2014 at 2:43 AM, Hongxu Jia <hongxu.jia at windriver.com> wrote:
>> ++      const size_t max_write = INT_MAX;
> I think INT_MAX is a mismatch here size_t may not be defined 'unsigned
> int' on all kind of architectures.

How about test the size of size_t and assigned the related MAX value:

const size_t max_write = (sizeof(size_t) >= 
sizeof(int))?INT_MAX:(sizeof(size_t) == sizeof(short))?SHRT_MAX:CHAR_MAX;

//Hongxu




More information about the Openembedded-core mailing list