From f92c1cfd2e16985d5ef86a24a6b0fc0e6772e39c Mon Sep 17 00:00:00 2001 From: Michal Rakowski Date: Thu, 21 Jan 2021 11:17:21 +0100 Subject: [PATCH] Fix #7261 About the director segfaulting due to too small msg buffer --- bacula/src/dird/catreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bacula/src/dird/catreq.c b/bacula/src/dird/catreq.c index 8c1c1f396..78f41f13a 100644 --- a/bacula/src/dird/catreq.c +++ b/bacula/src/dird/catreq.c @@ -817,7 +817,7 @@ bool despool_attributes_from_file(JCR *jcr, const char *file) goto bail_out; } if (msglen > 0) { - if (msglen > (int32_t) sizeof_pool_memory(msg)) { + if (msglen >= (int32_t) sizeof_pool_memory(msg)) { msg = realloc_pool_memory(msg, msglen + 1); } nbytes = fread(msg, 1, msglen, spool_fd); -- 2.47.3