WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xenpmd: Adjust strncat() length to avoid

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenpmd: Adjust strncat() length to avoid static buffer overflow.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 06 Dec 2008 04:20:10 -0800
Delivery-date: Sat, 06 Dec 2008 04:20:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xenpmd: Adjust strncat() length to avoid static buffer overflow., Xen patchbot-unstable <=