# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1228256242 0
# Node ID 2797ad5509252b49820fc1713209dc4cf95a9962
# Parent fc5208167bb69f7d02247644fd76a82a2649e310
xenpmd: Adjust strncat() length to avoid static buffer overflow.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
tools/xenpmd/xenpmd.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
diff -r fc5208167bb6 -r 2797ad550925 tools/xenpmd/xenpmd.c
--- a/tools/xenpmd/xenpmd.c Tue Dec 02 11:53:24 2008 +0000
+++ b/tools/xenpmd/xenpmd.c Tue Dec 02 22:17:22 2008 +0000
@@ -373,7 +373,7 @@ void write_battery_info_to_xenstore(stru
(unsigned int)strlen(info->serial_number), info->serial_number,
(unsigned int)strlen(info->battery_type), info->battery_type,
(unsigned int)strlen(info->oem_info), info->oem_info);
- strncat(val+73, string_info, 1024);
+ strncat(val+73, string_info, 1024-73-1);
xs_write(xs, XBT_NULL, "/pm/bif",
val, 73+8+strlen(info->model_number)+strlen(info->serial_number)+
strlen(info->battery_type)+strlen(info->oem_info)+1);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|