Whamcloud - gitweb
b=9300
authortappro <tappro>
Mon, 12 Sep 2005 23:21:21 +0000 (23:21 +0000)
committertappro <tappro>
Mon, 12 Sep 2005 23:21:21 +0000 (23:21 +0000)
no space was allocated for final zero at the end of string.

lustre/mds/mds_audit_path.c

index ded6750..0e9befc 100644 (file)
@@ -575,7 +575,7 @@ next:
                 item = list_entry(pos, struct name_item, link);
                 *namelen += strlen(item->name) + 1;
         }
-        OBD_ALLOC(*name, *namelen);
+        OBD_ALLOC(*name, *namelen + 1);
         if (*name == NULL)
                 rc = -ENOMEM;
 out:
@@ -587,6 +587,7 @@ out:
                 }
                 list_del_init(&item->link);
                 OBD_FREE(item, sizeof(*item));
+                LASSERT(strlen(*name) < *namelen);
         }
         RETURN(rc);
 }