mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
dm: virtio: use strnlen instead of strlen
Use strnlen instead of strlen to avoid potential security issue. Tracked-On: #1364 Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include <assert.h>
|
||||
#include <pthread.h>
|
||||
#include <termios.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "dm.h"
|
||||
#include "pci_core.h"
|
||||
@@ -326,7 +327,7 @@ virtio_console_announce_port(struct virtio_console_port *port)
|
||||
|
||||
event.event = VIRTIO_CONSOLE_PORT_NAME;
|
||||
virtio_console_control_send(port->console, &event, port->name,
|
||||
strlen(port->name));
|
||||
strnlen(port->name, NAME_MAX));
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user