minios: correct char array allocation for xenbus paths
authorMatt Wilson <msw@amazon.com>
Fri, 6 Sep 2013 19:52:04 +0000 (12:52 -0700)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 10 Sep 2013 09:54:34 +0000 (10:54 +0100)
commitf949cbbeda5dea85810de9eee7613add709e9e91
treeef6bcf11eb1c907657f7c66b8f904f8b8f8cb1db
parentde333b694591909787da54a40496fc82c8ba5b62
minios: correct char array allocation for xenbus paths

The char arrays used to hold xenbus paths have historically been
allocated by manually counting the length longest string constants
included in constructing the path. This has led to improperly sized
buffers, both too large (with little consequence) and too small (which
obviously causes problems). This patch corrects the instances where
the length was incorrectly calculated by using strlen() on the longest
string constant used in building a xenbus path.

A follow-on clean-up patch will change all instances to use strlen().

Signed-off-by: Ben Cressey <bcressey@amazon.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-By: Samuel Thibault <samuel.thibault@ens-lyon.org>
[msw: split this patch from a larger patch from Ben, reworked to use
 strlen()]
Signed-off-by: Matt Wilson <msw@amazon.com>
extras/mini-os/blkfront.c
extras/mini-os/console/xenbus.c
extras/mini-os/fbfront.c
extras/mini-os/netfront.c
extras/mini-os/pcifront.c