Message ID | 20241212204041.529835-1-gerben@altlinux.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v3] hw/display: refine upper limit for offset value in assert check | expand |
diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index 6ab2335499..3f1f5d81bd 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -896,7 +896,11 @@ static void xlnx_dp_write(void *opaque, hwaddr offset, uint64_t value, xlnx_dp_update_irq(s); break; default: - assert(offset <= (0x504C >> 2)); + /* + * Check to ensure the offset is within the bounds of + * the core_registers[] array. + */ + assert(offset < DP_CORE_REG_ARRAY_SIZE); s->core_registers[offset] = value; break; }