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

Khem Raj raj.khem at gmail.com
Tue Apr 1 14:57:20 UTC 2014


On Tue, Apr 1, 2014 at 12:40 AM, Hongxu Jia <hongxu.jia at windriver.com> wrote:
> 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;
>

you could use something like (size_t)-1 to denote SIZE_MAX

> //Hongxu
>



More information about the Openembedded-core mailing list