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 / devices / netdisk.c
index 403d9d5..8e0ec7f 100644 (file)
@@ -291,6 +291,7 @@ static int disk_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     PrintDebug(vm, VCORE_NONE, "Registering Net disk at %s:%s disk=%s\n", ip_str, port_str, disk_tag);
 
     strncpy(disk->disk_name, disk_tag, sizeof(disk->disk_name));
+    disk->disk_name[sizeof(disk->disk_name)-1] = 0;
     disk->ip_addr = v3_inet_addr(ip_str);
     disk->port = atoi(port_str);
     disk->vm = vm;