]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix #7261 About the director segfaulting due to too small msg buffer
authorMichal Rakowski <michal.rakowski@baculasystems.com>
Thu, 21 Jan 2021 10:17:21 +0000 (11:17 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:59 +0000 (09:02 +0100)
bacula/src/dird/catreq.c

index 8c1c1f3965a25c2a454e2444ff64b0e1419bc550..78f41f13a75464d02e02747905cb703b6e6cd15c 100644 (file)
@@ -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);