[libmediaart/ebassi/memdup: 1/2] Don't use a field before setting it
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libmediaart/ebassi/memdup: 1/2] Don't use a field before setting it
- Date: Thu, 20 May 2021 13:11:29 +0000 (UTC)
commit 2661e4414414e7c390f6fea20c258a83472afb82
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu May 20 14:07:46 2021 +0100
Don't use a field before setting it
We are using the data->len field in our g_memdup() call before we're
actually setting it; since the data structure is zero-filled, it means
we're not copying the buffer at all.
libmediaart/extract.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/libmediaart/extract.c b/libmediaart/extract.c
index d505285..bef8c0d 100644
--- a/libmediaart/extract.c
+++ b/libmediaart/extract.c
@@ -1366,8 +1366,8 @@ process_data_new (MediaArtType type,
data->uri = g_strdup (uri);
- data->buffer = g_memdup (buffer, data->len);
data->len = len;
+ data->buffer = g_memdup (buffer, data->len);
data->mime = g_strdup (mime);
data->artist = g_strdup (artist);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]