On Fri, Feb 14, 2014 at 09:49:51AM -0500, Dwight Engen wrote:
> also fix the check if the string will fit the local buffer
> 
> Signed-off-by: Dwight Engen <[email protected]>

Acked-by: Stéphane Graber <[email protected]>

> ---
>  src/lxc/cgmanager.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c
> index 41ba3d3..e4bd734 100644
> --- a/src/lxc/cgmanager.c
> +++ b/src/lxc/cgmanager.c
> @@ -422,8 +422,10 @@ static inline bool cgm_create(void *hdata)
>       tmp = lxc_string_replace("%n", d->name, d->cgroup_pattern);
>       if (!tmp)
>               return false;
> -     if (strlen(tmp) > MAXPATHLEN)
> +     if (strlen(tmp) >= MAXPATHLEN) {
> +             free(tmp);
>               return false;
> +     }
>       strcpy(result, tmp);
>       baselen = strlen(result);
>       free(tmp);
> -- 
> 1.8.5.3
> 
> _______________________________________________
> lxc-devel mailing list
> [email protected]
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

Attachment: signature.asc
Description: Digital signature

_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to