diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-29 10:52:17 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-29 10:52:17 +0000 |
commit | 45ce6547e6bde8cdf8f3dcaba833a3bda8f3c889 (patch) | |
tree | 9ce439909a9e3816fbac7b29bac84009fced953e /xen/common/gdbstub.c | |
parent | c642ec17d0d541835334b676e972539fdd5becdc (diff) | |
download | xen-45ce6547e6bde8cdf8f3dcaba833a3bda8f3c889.tar.gz xen-45ce6547e6bde8cdf8f3dcaba833a3bda8f3c889.tar.bz2 xen-45ce6547e6bde8cdf8f3dcaba833a3bda8f3c889.zip |
Replace sprintf with snprintf and strncpy with strlcpy.
There are various cases where no NULL-terminated strings are
guaranteed and eventual possible overflows. This patch fixes them.
From: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common/gdbstub.c')
-rw-r--r-- | xen/common/gdbstub.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xen/common/gdbstub.c b/xen/common/gdbstub.c index 8c863080e0..b9dfd08bbc 100644 --- a/xen/common/gdbstub.c +++ b/xen/common/gdbstub.c @@ -268,7 +268,7 @@ gdb_send_packet(struct gdb_context *ctx) char buf[3]; int count; - sprintf(buf, "%.02x\n", ctx->out_csum); + snprintf(buf, sizeof(buf), "%.02x\n", ctx->out_csum); gdb_write_to_packet_char('#', ctx); gdb_write_to_packet(buf, 2, ctx); |