diff options
author | vhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com> | 2006-03-15 12:24:34 +0000 |
---|---|---|
committer | vhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com> | 2006-03-15 12:24:34 +0000 |
commit | 3645dec05616d68a280a7e7a681bc58637e4c64a (patch) | |
tree | f86ae3b169d37482e7281e8af5e080d1bbd80e80 /tools/xenstore/xenstored_core.c | |
parent | 9d34613c4e15899b64e18b00a7ea1c8b411de31d (diff) | |
download | xen-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.c | 11 |
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 |