Re: [PATCH] Fix memswp. It's scratch space was too small.

From: Jens Axboe <jens.axboe_at_oracle.com>
Date: Thu, 2 Aug 2007 22:19:56 +0200

On Thu, Aug 02 2007, Shawn Lewis wrote:
> diff --git a/verify.c b/verify.c
> index d9a68d6..6f67dff 100644
> --- a/verify.c
> +++ b/verify.c
> @@ -83,7 +83,9 @@ static void fill_pattern(struct thread_d
>
> static void memswp(void* buf1, void* buf2, unsigned int len)
> {
> - struct verify_header swap;
> + char swap[200];
> +
> + assert(len <= sizeof(swap));
>
> memcpy(&swap, buf1, len);
> memcpy(buf1, buf2, len);

Thanks, applied.

-- 
Jens Axboe
Received on Thu Aug 02 2007 - 22:19:56 CEST

This archive was generated by hypermail 2.2.0 : Thu Aug 02 2007 - 22:30:01 CEST