[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Jailkit-dev] Error when running program inside jail using relative

From: Olivier Sessink
Subject: Re: [Jailkit-dev] Error when running program inside jail using relative path
Date: Sun, 21 Nov 2010 20:55:47 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20101027 Thunderbird/3.0.10

On 11/18/2010 01:28 PM, Christopher Hesse wrote:
> With jailkit-2.13 I seem to be getting an error if I specify a relative
> path to the program being run.  
> From jk_chrootlaunch.c:
> /* the executable was specified as relative path to the jail, combine
> them together */
>                 tmpstr = malloc0((strlen(exec)+strlen(jail))*sizeof(char));
>                 tmpstr = strcat(strcat(tmpstr, jail), exec);
> Looks to me that tmpstr is not malloced enough space for the null byte
> at the end.  Depending on some random factors, it seems this can
> sometimes fail.  I added a +1 to the malloc0 size and it seems to work.
>  Does this seem right to you guys?

that is 100% right, the trailing \0 should also fit in memory. Thanks
for reporting, fixed in CVS.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]