Re: [xar] Memory bug
Re: [xar] Memory bug
- Subject: Re: [xar] Memory bug
- From: "dev.iceberg" <email@hidden>
- Date: Mon, 12 Feb 2018 10:46:42 +0100
I would tend to believe it does at a higher level. Because, IIRC what I saw
during step debugging, if you don't have characters outside the ASCII range,
the name of the file is not encoded during the creation of the archive. So the
base64 branch is not invoked when unarchving or listing the contents of the
archive.
Envoyé de mon iPhone
> Le 11 févr. 2018 à 11:11, Jean-Daniel <email@hidden> a écrit :
>
>
>
>> Le 11 févr. 2018 à 01:10, Stephane Sudre <email@hidden> a écrit :
>>
>> Just for info.
>>
>> There's a bug in the xar_from_base64 function of the b64.c file of the
>> xar project (which is used in pkgutil and probably in
>> PackageKit.framework).
>>
>> The output of the function can be incorrect because the output array
>> of unsigned chars is is not set to 0.
>>
>> This is the bug:
>>
>> output = malloc(3 * (inputLength / 4 + 1));
>>
>> So in case output is allocated to some location that was previously
>> used, the contents of output will not be a bunch of zeroes (so no
>> terminating NULL char after the last decoded character). And anyway,
>> it should not be assumed to be a bunch of zeroes.
>>
>> It just happens that having a distribution package (.pkg) containing a
>> Package name with some accented characters (such as é) will trigger
>> the bug every single time when using pkgutil --expand or xar -tc
>
> I’m not sure the accented char has anything to do with that.
> I would rather guess this is because your package malloc small enough space
> that the system don’t have to use the big malloc zone (which usually provide
> fresh pages that are zeroed lazily).
>
>>
>> This problem can be reproduced on Mac OS X 10.10.5 and 10.11.6 with
>> the Apple built binaries and it can be reproduced using the latest xar
>> source code available on opensource.apple.com (xar-400). And based on
>> what I see in xar-28, the problem is apparently there since Mac OS X
>> 10.5.0.
>>
>> Problem# 37427477
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden