summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2024-02-20 05:02:57 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2024-02-20 17:57:46 +0100
commit4992110829162e3d25ff0a17362f3edeeff71d03 (patch)
tree98ba5178f064968e918492aab8ace7175f203eb9
parent53f2539b6a410984c43af96ffd81113ddd6ad21b (diff)
fpi-byte-writer: Zero-init the allocated data by default
This could have been done via fill method + pos reset, but it's just something we normally want to do for safety, so let's do it all the times.
-rw-r--r--libfprint/fpi-byte-writer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libfprint/fpi-byte-writer.c b/libfprint/fpi-byte-writer.c
index 80c2c04..cb3514a 100644
--- a/libfprint/fpi-byte-writer.c
+++ b/libfprint/fpi-byte-writer.c
@@ -75,7 +75,7 @@ fpi_byte_writer_new_with_size (guint size, gboolean fixed)
FpiByteWriter *ret = fpi_byte_writer_new ();
ret->alloc_size = size;
- ret->parent.data = g_malloc (ret->alloc_size);
+ ret->parent.data = g_malloc0 (ret->alloc_size);
ret->parent.size = size;
ret->fixed = fixed;
ret->owned = TRUE;
@@ -143,7 +143,7 @@ fpi_byte_writer_init_with_size (FpiByteWriter * writer, guint size,
fpi_byte_writer_init (writer);
- writer->parent.data = g_malloc (size);
+ writer->parent.data = g_malloc0 (size);
writer->parent.size = size;
writer->alloc_size = size;
writer->fixed = fixed;