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] / linux_module / iface-env-inject.c
index af8ff6d..af60915 100644 (file)
@@ -68,7 +68,8 @@ static int vm_env_inject (struct v3_guest * guest, unsigned int cmd, unsigned lo
 
     env->num_strings = env_arg.num_strings;
     
-    strcpy(env->bin_name, env_arg.bin_name);
+    strncpy(env->bin_name, env_arg.bin_name, MAX_STRING_LEN);
+    env->bin_name[MAX_STRING_LEN-1] = 0;
     DEBUG("Binary hooked on: %s\n", env->bin_name);
 
     //DEBUG("Palacios: Allocating space for %u env var string ptrs...\n", env->num_strings);