Skip to content
Snippets Groups Projects
Commit 0bc9f998 authored by Robert Edmonds's avatar Robert Edmonds Committed by Jan Včelák
Browse files

dnstap: Fix ProtobufCBufferSimple usage that is incorrect as of protobuf-c 1.0.0


protobuf-c 1.0.0 added a new 'allocator' field to ProtobufCBufferSimple
that controls memory allocation, which must be NULL in order to request
the default system allocator. Allocating ProtobufCBufferSimple objects
on the stack without zeroing the entire object can result in
protobuf-c's memory allocation functions dereferencing a garbage
pointer.

Signed-off-by: default avatarJan Vcelak <jan.vcelak@nic.cz>
parent 19af2a9b
Branches
Tags
No related merge requests found
......@@ -23,7 +23,7 @@
uint8_t* dt_pack(const Dnstap__Dnstap *d, uint8_t **buf, size_t *sz)
{
ProtobufCBufferSimple sbuf;
ProtobufCBufferSimple sbuf = {0};
sbuf.base.append = protobuf_c_buffer_simple_append;
sbuf.len = 0;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment