bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH 4/4] xen: fix buffer size


From: Samuel Thibault
Subject: Re: [PATCH 4/4] xen: fix buffer size
Date: Tue, 4 Feb 2014 11:54:01 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Justus Winter, le Tue 04 Feb 2014 11:50:04 +0100, a écrit :
> Previously, only strlen(device_name) bytes were allocated, missing one
> byte for the terminating zero.
> 
> * xen/block.c (hyp_block_init): Fix buffer size.

Ack!

> ---
>  xen/block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/block.c b/xen/block.c
> index 3e4ce7c..bd3758f 100644
> --- a/xen/block.c
> +++ b/xen/block.c
> @@ -217,7 +217,7 @@ void hyp_block_init(void) {
>                       sprintf(device_name, "%s%ds%d", prefix, disk, 
> partition);
>               else
>                       sprintf(device_name, "%s%d", prefix, disk);
> -             bd->name = (char*) kalloc(strlen(device_name));
> +             bd->name = (char*) kalloc(strlen(device_name) + 1);
>               strcpy(bd->name, device_name);
>  
>               /* Get domain id of backend driver.  */
> -- 
> 1.8.5.2
> 

-- 
Samuel
<N> je déteste import
<N> parce que lorsque tu fais du python et que tu oublies le #!/bin/env python 
et que tu mets le fichier exécutable
<N> import est exécuté
 -+- #ens-mim - pourquoi mon script python change le curseur de la souris ?! -+-



reply via email to

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