From: Eric Bollengier Date: Wed, 15 Sep 2021 07:38:45 +0000 (+0200) Subject: Modify meta_pkt to always have a terminated buffer X-Git-Tag: Beta-15.0.0~881 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaa96ae5f3a735d7efef62a0060d2456951bf198;p=thirdparty%2Fbacula.git Modify meta_pkt to always have a terminated buffer --- diff --git a/bacula/src/filed/fd_plugins.h b/bacula/src/filed/fd_plugins.h index 1475d98c7..5c3f1a906 100644 --- a/bacula/src/filed/fd_plugins.h +++ b/bacula/src/filed/fd_plugins.h @@ -168,8 +168,9 @@ struct meta_pkt: public SMARTALLOC { unser_uint32((uint32_t&) type); unser_uint16(index); unser_uint32(buf_len); - buf = bmalloc(buf_len); + buf = bmalloc(buf_len+1); unser_bytes(buf, buf_len); + ((char*)buf)[buf_len]=0; /* useful for debug */ } else { total_size = 0; total_count = 0;