aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstored_core.c
diff options
context:
space:
mode:
authorvhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>2006-03-15 12:24:34 +0000
committervhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>2006-03-15 12:24:34 +0000
commit3645dec05616d68a280a7e7a681bc58637e4c64a (patch)
treef86ae3b169d37482e7281e8af5e080d1bbd80e80 /tools/xenstore/xenstored_core.c
parent9d34613c4e15899b64e18b00a7ea1c8b411de31d (diff)
downloadxen-3645dec05616d68a280a7e7a681bc58637e4c64a.tar.gz
xen-3645dec05616d68a280a7e7a681bc58637e4c64a.tar.bz2
xen-3645dec05616d68a280a7e7a681bc58637e4c64a.zip
fix buffer overflow in print XS_DEBUG command
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
Diffstat (limited to 'tools/xenstore/xenstored_core.c')
-rw-r--r--tools/xenstore/xenstored_core.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 7076046801..afede2f454 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1115,8 +1115,17 @@ static void do_set_perms(struct connection *conn, struct buffered_data *in)
static void do_debug(struct connection *conn, struct buffered_data *in)
{
- if (streq(in->buffer, "print"))
+ int num;
+
+ num = xs_count_strings(in->buffer, in->used);
+
+ if (streq(in->buffer, "print")) {
+ if (num < 2) {
+ send_error(conn, EINVAL);
+ return;
+ }
xprintf("debug: %s", in->buffer + get_string(in, 0));
+ }
if (streq(in->buffer, "check"))
check_store();
#ifdef TESTING