Hi Daniel,
This patch correctly terminates the string returned by readlink(2) with a NULL
charactor.
Thanks,
Ryousei
---
src/lxc/start.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lxc/start.c b/src/lxc/start.c
index 032fdf6..684a700 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -191,7 +191,7 @@ static int fdname(int fd, char *name, size_t size)
len = readlink(path, name, size);
if (len > 0)
- path[len] = '\0';
+ name[len] = '\0';
return (len <= 0) ? -1 : 0;
}
@@ -244,7 +244,7 @@ struct lxc_handler *lxc_init(const char *name, struct
lxc_conf *conf)
goto out_free;
}
- if (console_init(conf->console, sizeof(conf->console))) {
+ if (console_init(conf->console, sizeof(conf->console) - 1)) {
ERROR("failed to initialize the console");
goto out_aborting;
}
--
1.5.5.6
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Lxc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lxc-devel