summaryrefslogtreecommitdiff
path: root/xen
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-02-04 11:47:00 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-02-04 15:21:06 +0100
commit03df518586e3cfd106eb20827781f12a0596e48c (patch)
tree56e82757bb9e584c66efc22f3667aabc4107d4b1 /xen
parent172f3ea324a3685a62b03edd8b03e5f09e265301 (diff)
xen: fix buffer size
Previously, only strlen(device_name) bytes were allocated, missing one byte for the terminating zero. * xen/block.c (hyp_block_init): Fix buffer size.
Diffstat (limited to 'xen')
-rw-r--r--xen/block.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xen/block.c b/xen/block.c
index 3e4ce7c..bd3758f 100644
--- a/xen/block.c
+++ b/xen/block.c
@@ -217,7 +217,7 @@ void hyp_block_init(void) {
sprintf(device_name, "%s%ds%d", prefix, disk, partition);
else
sprintf(device_name, "%s%d", prefix, disk);
- bd->name = (char*) kalloc(strlen(device_name));
+ bd->name = (char*) kalloc(strlen(device_name) + 1);
strcpy(bd->name, device_name);
/* Get domain id of backend driver. */