From 03df518586e3cfd106eb20827781f12a0596e48c Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Tue, 4 Feb 2014 11:47:00 +0100 Subject: 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. --- xen/block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xen') 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. */ -- cgit v1.2.3