[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v3 08/10] xl: correctly handle null extra config in main_config_update
Don't dereference NULL. Also fixed a typo in error string while I was there. Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- tools/libxl/xl_cmdimpl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 607db4e..888f729 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -5010,9 +5010,9 @@ int main_config_update(int argc, char **argv) if (rc) { fprintf(stderr, "Failed to read config file: %s: %s\n", filename, strerror(errno)); free(extra_config); return ERROR_FAIL; } - if (strlen(extra_config)) { + if (extra_config && strlen(extra_config)) { if (config_len > INT_MAX - (strlen(extra_config) + 2 + 1)) { - fprintf(stderr, "Failed to attach extra configration\n"); + fprintf(stderr, "Failed to attach extra configuration\n"); exit(1); } /* allocate space for the extra config plus two EOLs plus \0 */ -- 1.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |