]> git.ipfire.org Git - thirdparty/qemu.git/blobdiff - device_tree.c
hw/arm/boot: Set NSACR.{CP11, CP10} in dummy SMC setup routine
[thirdparty/qemu.git] / device_tree.c
index 296278e12ae01020e7c0b8564587a7fa4d2dcf16..f8b46b3c7331ae42dcc3be5ee4c5ce3d370d47c6 100644 (file)
@@ -84,6 +84,10 @@ void *load_device_tree(const char *filename_path, int *sizep)
                      filename_path);
         goto fail;
     }
+    if (dt_size > INT_MAX / 2 - 10000) {
+        error_report("Device tree file '%s' is too large", filename_path);
+        goto fail;
+    }
 
     /* Expand to 2x size to give enough room for manipulation.  */
     dt_size += 10000;