[OE-core] [PATCH 2/2] icu 3.6: do_install failed: Segmentation fault

Robert Yang liezhi.yang at windriver.com
Fri Jun 29 05:26:59 UTC 2012



On 06/29/2012 12:54 PM, Khem Raj wrote:
> On Thu, Jun 28, 2012 at 6:54 PM, Robert Yang<liezhi.yang at windriver.com>  wrote:
>> I've changed the cmd[BUFSIZ] to cmd[2048], which should be enough for us,
>> and
>> pushed it to the git repo again:
>
> ideally allocating a string on heap and then freeing
> it after use would fix this issue once for all.
>

Thanks Khem, but the problem is that even we use:

void *malloc(size_t size)

We should still use a constant size since the length of the command
is unknown (or not obviously known):

#else
     sprintf(cmd, "%s %s%s -f %s %s %s %s %s",
         make,
         o->install ? "INSTALLTO=" : "",
         o->install ? o->install    : "",
         o->makeFile,
         o->clean   ? "clean"      : "",
         o->rebuild ? "rebuild"    : "",
         o->install ? "install"    : "",
         o->makeArgs);

So I simply increase the size of cmd[] which is a simple fix.

// Robert

> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>




More information about the Openembedded-core mailing list