The SSD0323 is an 8-bit SPI peripheral, but the transfer function
receives a uint32_t. Mask the value to 8 bits before storing it as
a command or command data, preventing upper bits from leaking into
command dispatch and parameter values.

Reported-by: Pavee Hui <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
---
 hw/display/ssd0323.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/display/ssd0323.c b/hw/display/ssd0323.c
index 9309d4d10c4a..6172596abe6c 100644
--- a/hw/display/ssd0323.c
+++ b/hw/display/ssd0323.c
@@ -102,6 +102,7 @@ static uint32_t ssd0323_transfer(SSIPeripheral *dev, 
uint32_t data)
         break;
     case SSD0323_CMD:
         DPRINTF("cmd 0x%02x\n", data);
+        data &= 0xff;
         if (s->cmd_len == 0) {
             s->cmd = data;
         } else {

-- 
2.56.0.rc0.29.g47ce80527c56


Reply via email to