Index: /trunk/src/VBox/Devices/PC/DevAPIC.cpp
===================================================================
--- /trunk/src/VBox/Devices/PC/DevAPIC.cpp	(revision 19786)
+++ /trunk/src/VBox/Devices/PC/DevAPIC.cpp	(revision 19787)
@@ -2250,4 +2250,9 @@
 
     Log(("APIC: cCpus=%d fR0Enabled=%RTbool fGCEnabled=%RTbool fIOAPIC=%RTbool\n", cCpus, fR0Enabled, fGCEnabled, fIOAPIC));
+
+    /* TODO: Current implementation is limited to 32 CPUs due to the use of 32 bits bitmasks. */
+    if (cCpus > 32)
+        return PDMDEV_SET_ERROR(pDevIns, rc,
+                                N_("Configuration error: Invalid value for \"NumCPUs\""));
 
     /*
