On 06/29/2012 12:54 PM, Khem Raj wrote:
On Thu, Jun 28, 2012 at 6:54 PM, Robert Yang<liezhi.y...@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@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



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

Reply via email to