Re: [PATCH] btrfs-progs: sanitize - Use correct source for memcpy

2017-01-23 Thread David Sterba
On Fri, Jan 20, 2017 at 01:03:33PM -0600, Goldwyn Rodrigues wrote:
> From: Goldwyn Rodrigues 
> 
> While performing a memcpy, we are copying from uninitialized dst
> as opposed to src->data. Though using eb->len is correct, I used
> src->len to make it more readable.
> 
> Signed-off-by: Goldwyn Rodrigues 

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] btrfs-progs: sanitize - Use correct source for memcpy

2017-01-20 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues 

While performing a memcpy, we are copying from uninitialized dst
as opposed to src->data. Though using eb->len is correct, I used
src->len to make it more readable.

Signed-off-by: Goldwyn Rodrigues 
---
 image/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/image/main.c b/image/main.c
index 58dcecb..0158844 100644
--- a/image/main.c
+++ b/image/main.c
@@ -550,7 +550,7 @@ static void sanitize_name(struct metadump_struct *md, u8 
*dst,
return;
}
 
-   memcpy(eb->data, dst, eb->len);
+   memcpy(eb->data, src->data, src->len);
 
switch (key->type) {
case BTRFS_DIR_ITEM_KEY:
-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html