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.


Lots of pedantic error checking in Palacios proper, especially for memory
[palacios.git] / palacios / src / palacios / vmm_string.c
index 75a8975..af102f7 100644 (file)
@@ -71,6 +71,11 @@ void * memcpy(void * dst, const void * src, size_t n) {
 #ifdef V3_CONFIG_BUILT_IN_MEMMOVE
 void * memmove(void * dst, const void * src, size_t n) {
     uint8_t * tmp = (uint8_t *)V3_Malloc(n);
+
+    if (!tmp) {
+       PrintError("Cannot allocate in built-in memmove\n");
+       return NULL;
+    }
     
     memcpy(tmp, src, n);
     memcpy(dst, tmp, n);
@@ -285,6 +290,12 @@ char * strdup(const char * s1) {
     char *ret;
 
     ret = V3_Malloc(strlen(s1) + 1);
+
+    if (!ret) {
+       PrintError("Cannot allocate in built-in strdup\n");
+       return NULL;
+    }
+
     strcpy(ret, s1);
 
     return ret;