jailkit-dev
[Top][All Lists]
Advanced

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

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


From: Christopher Hesse
Subject: [Jailkit-dev] Error when running program inside jail using relative path
Date: Thu, 18 Nov 2010 04:28:52 -0800

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?

Thanks,
Chris

reply via email to

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