qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qemu_strdup() doesn't copy alast character


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH] qemu_strdup() doesn't copy alast character
Date: Mon, 25 Aug 2008 23:05:19 +0300

On 8/25/08, Gleb Natapov <address@hidden> wrote:
>
>  Because of off by one error.
>
>
>  Signed-off-by: Gleb Natapov <address@hidden>
>
>  diff --git a/qemu-malloc.c b/qemu-malloc.c
>  index 8ad6168..3bffae1 100644
>  --- a/qemu-malloc.c
>  +++ b/qemu-malloc.c
>  @@ -60,6 +60,6 @@ char *qemu_strdup(const char *str)
>      ptr = qemu_malloc(len + 1);
>      if (!ptr)
>          return NULL;
>  -    pstrcpy(ptr, len, str);
>  +    pstrcpy(ptr, len + 1, str);
>      return ptr;
>   }

Thanks, applied. I had introduced this in the patch (r5044) where I
changed some strcpys to pstrcpys. Maybe the same bug got in somewhere
else too.




reply via email to

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