]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
mssql: Fix #7777 About 'Create database Plugin Object record' error
authorEric Bollengier <eric@baculasystems.com>
Fri, 18 Jun 2021 08:30:02 +0000 (10:30 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:02 +0000 (09:03 +0100)
bacula/src/cats/cats.c

index 3c40dcdc2550feb29e16e4b9391d8dc5d05bc0ed..aa0fe9d060decb4781972c7b63b01a474f9ff62c 100644 (file)
@@ -225,12 +225,16 @@ bool OBJECT_DBR::parse_plugin_object_string(char **obj_str)
 
    tmp = get_next_tag(obj_str);
    if (tmp) {
-      ObjectSize = str_to_uint64(tmp);
+      uint64_t val = str_to_uint64(tmp);
+      ObjectSize = (val > 9223372036854775808ULL /*2^63 */) ? 0 : val;
+
    } else if (*obj_str) {
       /* Object size is the last tag here, we are not expecting to have status in the stream */
-      ObjectSize = str_to_uint64(*obj_str);
+      uint64_t val = str_to_uint64(*obj_str);
+      ObjectSize = (val > 9223372036854775808ULL /*2^63 */) ? 0 : val;
       ret = true;
       goto bail_out;
+
    } else {
       goto bail_out;
    }