summaryrefslogtreecommitdiff
path: root/examples/vm_power_manager
diff options
context:
space:
mode:
authorDaniel Mrzyglod <danielx.t.mrzyglod@intel.com>2016-05-10 17:49:22 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-05-16 14:48:09 +0200
commit42b3f505581ce30ef1f83b96409755f70068d2eb (patch)
treed96cae59a67d33aff50e30b8257cf231ea72a87f /examples/vm_power_manager
parentf87a9ddc4af4dcb0c21132a5494b24049d41c19c (diff)
downloaddpdk-42b3f505581ce30ef1f83b96409755f70068d2eb.zip
dpdk-42b3f505581ce30ef1f83b96409755f70068d2eb.tar.gz
dpdk-42b3f505581ce30ef1f83b96409755f70068d2eb.tar.xz
examples/vm_power_manager: ensure domain name is null terminated
In add_vm: The string buffer may not have a null terminator if the source string's length is equal to the buffer size Coverity issue: 30691 Fixes: e8ae9b662506 ("examples/vm_power: channel manager and monitor in host") Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Diffstat (limited to 'examples/vm_power_manager')
-rw-r--r--examples/vm_power_manager/channel_manager.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index 22c2ddd..e068ae2 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -667,6 +667,7 @@ add_vm(const char *vm_name)
return -1;
}
strncpy(new_domain->name, vm_name, sizeof(new_domain->name));
+ new_domain->name[sizeof(new_domain->name) - 1] = '\0';
new_domain->channel_mask = 0;
new_domain->num_channels = 0;