]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - lib/buffer.c
lib/buffer: make sure buffer without data is zero terminated [asan]
[thirdparty/util-linux.git] / lib / buffer.c
index 4cd9fcf65c68957eee2378df1c7222b310120c74..d1d608ff58482c517bc1189ef2ef9d67693a0175 100644 (file)
@@ -122,6 +122,8 @@ int ul_buffer_alloc_data(struct ul_buffer *buf, size_t sz)
        buf->end = buf->begin + len;
        buf->sz = sz;
 
+       memset(buf->end, '\0', sz - len);
+
        return 0;
 }