On Thu, Jun 28, 2012 at 6:54 PM, Robert Yang <liezhi.yang@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.

On 06/29/2012 12:54 PM, Khem Raj wrote:
> On Thu, Jun 28, 2012 at 6:54 PM, Robert Yang<liezhi.yang@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>>

On Thu, Jun 28, 2012 at 10:26 PM, Robert Yang <liezhi.yang@windriver.com> wrote:
> We should still use a constant size since the length of the command> is unknown (or not obviously known):
thats the point. Cant you use srtlen(cmd) ?

On 06/29/2012 02:06 PM, Khem Raj wrote:
> On Thu, Jun 28, 2012 at 10:26 PM, Robert Yang<liezhi.yang@windriver.com> wrote:>> We should still use a constant size since the length of the command>> is unknown (or not obviously known):>> thats the point. Cant you use srtlen(cmd) ?>
I'm afraid not, as the code shows below, we should strlen()
each component of the cmd:
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);
and this is only the part for linux os, it still has similar parts for
U_WINDOWS and OS400 (the component are different), if we strlen() each
one of them, that would make it complicated. the icu pkg does use many
malloc() in the other part of code, but it uses the char array here,
I think that maybe this is the reason.
// Robert
>

On Thu, Jun 28, 2012 at 11:30 PM, Robert Yang <liezhi.yang@windriver.com> wrote:
>>> On 06/29/2012 02:06 PM, Khem Raj wrote:>>>> On Thu, Jun 28, 2012 at 10:26 PM, Robert Yang<liezhi.yang@windriver.com>>> wrote:>>>>>> We should still use a constant size since the length of the command>>> is unknown (or not obviously known):>>>>>> thats the point. Cant you use srtlen(cmd) ?>>>> I'm afraid not, as the code shows below, we should strlen()> each component of the cmd:>>> 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);>> and this is only the part for linux os, it still has similar parts for> U_WINDOWS and OS400 (the component are different), if we strlen() each> one of them, that would make it complicated. the icu pkg does use many> malloc() in the other part of code, but it uses the char array here,> I think that maybe this is the reason.>
OK its fine what you have
> // Robert>>>>