mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 05:30:24 +00:00
DM: virtio-gpio: fix array overflow issue
explicitly initialize the cmd_cap string array. Tracked-On: #3001 Signed-off-by: Yuan Liu <yuan1.liu@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
parent
fb9bd2a19a
commit
90343a48fa
@ -1571,13 +1571,14 @@ print_virtio_gpio_info(struct virtio_gpio_request *req,
|
||||
struct virtio_gpio_response *rsp, bool in)
|
||||
{
|
||||
const char *item;
|
||||
const char *const cmd_map[] = {
|
||||
const char *const cmd_map[GPIO_REQ_MAX + 1] = {
|
||||
"GPIO_REQ_SET_VALUE",
|
||||
"GPIO_REQ_GET_VALUE",
|
||||
"GPIO_REQ_INPUT_DIRECTION",
|
||||
"GPIO_REQ_OUTPUT_DIRECTION",
|
||||
"GPIO_REQ_GET_DIRECTION",
|
||||
"GPIO_REQ_SET_CONFIG",
|
||||
"GPIO_REQ_MAX",
|
||||
};
|
||||
|
||||
if (req->cmd == GPIO_REQ_SET_VALUE || req->cmd == GPIO_REQ_GET_VALUE)
|
||||
|
Loading…
Reference in New Issue
Block a user