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

Re: [Xen-devel] [PATCH] memshr: fix off-by-one in filename size check



On Thu, 2013-11-28 at 23:17 +1300, Matthew Daley wrote:
> Signed-off-by: Matthew Daley <mattd@xxxxxxxxxxx>

Acked + applied, thanks.

Andres -- should you have an entry in MAINTAINERS for this code?

> ---
>  tools/memshr/shm.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/memshr/shm.c b/tools/memshr/shm.c
> index c925cf2..30975dc 100644
> --- a/tools/memshr/shm.c
> +++ b/tools/memshr/shm.c
> @@ -217,9 +217,9 @@ uint16_t shm_vbd_image_get(const char* file, 
> vbd_image_info_t *vbd_imgs)
>          DPRINTF("No space in vbds table.\n");
>          return 0;
>      }
> -    if(strlen(file) > MAX_NAME_LEN)
> +    if(strlen(file) > MAX_NAME_LEN - 1)
>      {
> -        DPRINTF("Filename: %s too long (>%d).\n", file, MAX_NAME_LEN);
> +        DPRINTF("Filename: %s too long (>%d).\n", file, MAX_NAME_LEN - 1);
>          return 0; 
>      }
>      /* Init the entry */



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.