]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Modify meta_pkt to always have a terminated buffer
authorEric Bollengier <eric@baculasystems.com>
Wed, 15 Sep 2021 07:38:45 +0000 (09:38 +0200)
committerEric Bollengier <eric@baculasystems.com>
Fri, 30 Jun 2023 18:35:17 +0000 (20:35 +0200)
bacula/src/filed/fd_plugins.h

index 1475d98c7aaca602138e46d700f9bf57f0382ac5..5c3f1a90611235021bff0e1f47b1881d98b7264f 100644 (file)
@@ -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;