X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm.c;h=dbb1b8d0620579510ad36a0e67f682ab7775512d;hb=3e937e5468169b8183a22a90f6d07ff370abde0c;hp=57d567b91b900ff519b8350dfd6354a7dc4871b1;hpb=de5c2110458436a9300aa0a171dbbe83e415ee4d;p=palacios.git diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index 57d567b..dbb1b8d 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -339,7 +339,9 @@ struct v3_vm_info * v3_create_vm(void * cfg, void * priv_data, char * name, unsi } memset(vm->name, 0, 128); - strncpy(vm->name, name, 127); + strncpy(vm->name, name, 128); + vm->name[127] = 0; + if(v3_cpu_mapper_register_vm(vm) == -1) { @@ -748,6 +750,8 @@ int v3_move_vm_mem(struct v3_vm_info * vm, void *gpa, int target_cpu) { } // Note, assumes virtual contiguity in the host OS... + // A null deref here can only happen if the host does not provide the + // physical_to_virtual functions or if they do not work memcpy(V3_VAddr((void*)new_hpa), V3_VAddr((void*)(reg->host_addr)), num_pages*PAGE_SIZE); old_hpa = (void*)(reg->host_addr); @@ -1224,18 +1228,6 @@ v3_cpu_mode_t v3_get_host_cpu_mode() { #endif -void v3_print_cond(const char * fmt, ...) { - if (v3_dbg_enable == 1) { - char buf[2048]; - va_list ap; - - va_start(ap, fmt); - vsnprintf(buf, 2048, fmt, ap); - va_end(ap); - - V3_Print(VM_NONE, VCORE_NONE,"%s", buf); - } -}