Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Cleanup and sanity-checking of use of strncpy/strcpy (Coverity static analysis)
[palacios.git] / palacios / src / palacios / vmm_dev_mgr.c
index 0904ea1..45cb8d1 100644 (file)
@@ -172,6 +172,7 @@ int v3_save_vm_devices(struct v3_vm_info * vm, struct v3_chkpt * chkpt) {
     list_for_each_entry(dev, &(mgr->dev_list), dev_link) {
         if (dev->ops->save) {
             strncpy(name_table + tbl_offset, dev->name, V3_MAX_DEVICE_NAME);
+           *(name_table + tbl_offset + V3_MAX_DEVICE_NAME - 1) = 0;
             tbl_offset += V3_MAX_DEVICE_NAME;
             num_saved_devs++;
         }  else {
@@ -558,6 +559,7 @@ struct vm_device * v3_add_device(struct v3_vm_info * vm,
     INIT_LIST_HEAD(&(dev->res_hooks));
 
     strncpy(dev->name, name, 32);
+    dev->name[31] = 0;
     dev->ops = ops;
     dev->private_data = private_data;