mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sp-capture-writer: Initialize write buffer
Valgrind notes that the buffer is not fully initialized when we pass it to write(). This could potentially write sensitive data, if we are not careful with the buffer length. See https://gitlab.gnome.org/GNOME/gjs/issues/120 https://bugzilla.gnome.org/show_bug.cgi?id=794272
This commit is contained in:
committed by
Christian Hergert
parent
0b23643cbe
commit
c3d1fd0ff8
@ -425,7 +425,7 @@ sp_capture_writer_new_from_fd (int fd,
|
||||
self = g_new0 (SpCaptureWriter, 1);
|
||||
self->ref_count = 1;
|
||||
self->fd = fd;
|
||||
self->buf = (guint8 *)g_malloc (buffer_size);
|
||||
self->buf = (guint8 *)g_malloc0 (buffer_size);
|
||||
self->len = buffer_size;
|
||||
self->next_counter_id = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user