[CRIU] [PATCH] zdtm: don't write more than buffer size

Pavel Emelyanov xemul at parallels.com
Tue Feb 4 06:28:04 PST 2014


On 02/02/2014 12:49 AM, Andrey Vagin wrote:
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  test/zdtm/lib/ns.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c
> index fb6d70e..fb2ac11 100644
> --- a/test/zdtm/lib/ns.c
> +++ b/test/zdtm/lib/ns.c
> @@ -145,7 +145,7 @@ static void ns_sig_hand(int signo)
>  	return;
>  write_out:
>  	/* fprintf can't be used in a sighandler due to glibc locks */
> -	write(STDERR_FILENO, buf, MAX(len, sizeof(buf)));
> +	write(STDERR_FILENO, buf, MIN(len, sizeof(buf)));
>  }
>  
>  #define STATUS_FD 255
> 

applied


More information about the CRIU mailing list