9 messages in com.xensource.lists.xen-develRe: [Xen-devel] [PATCH] Clean up and ...| From | Sent On | Attachments |
|---|---|---|
| Aron Griffis | 29 Jan 2007 17:10 | |
| Christoph Egger | 30 Jan 2007 00:22 | |
| Keir Fraser | 30 Jan 2007 01:32 | |
| Aron Griffis | 30 Jan 2007 05:47 | |
| Christoph Egger | 30 Jan 2007 06:01 | |
| Christoph Egger | 30 Jan 2007 07:26 | |
| Keir Fraser | 30 Jan 2007 07:46 | |
| Alex Williamson | 30 Jan 2007 09:29 | |
| Keir Fraser | 30 Jan 2007 09:36 |
| Subject: | Re: [Xen-devel] [PATCH] Clean up and fix errors in strncpy -> strlcpy conversion![]() |
|---|---|
| From: | Aron Griffis (ar...@hp.com) |
| Date: | 01/30/2007 05:47:22 AM |
| List: | com.xensource.lists.xen-devel |
Christoph Egger wrote: [Tue Jan 30 2007, 03:23:07AM EST]
On Tuesday 30 January 2007 02:10, Aron Griffis wrote:
This patch is for the staging tree. Please apply.
# HG changeset patch # User Aron Griffis <ar...@hp.com> # Date 1170118368 18000 # Node ID 23560e2248fd267bad6490113ed52d0a27d7e219 # Parent 5e3b47bcc311e7698959f1fa79c4654190593499 Clean up and fix errors in strncpy -> strlcpy conversion
Signed-off-by: Aron Griffis <ar...@hp.com>
diff -r 5e3b47bcc311 -r 23560e2248fd xen/arch/ia64/xen/dom_fw.c --- a/xen/arch/ia64/xen/dom_fw.c Mon Jan 29 22:43:51 2007 +0000 +++ b/xen/arch/ia64/xen/dom_fw.c Mon Jan 29 19:52:48 2007 -0500 @@ -333,13 +333,13 @@ dom_fw_fake_acpi(struct domain *d, struc memset(tables, 0, sizeof(struct fake_acpi_tables));
/* setup XSDT (64bit version of RSDT) */ - strlcpy(xsdt->signature, XSDT_SIG, sizeof(xsdt->signature)); + memcpy(xsdt->signature, XSDT_SIG, sizeof(xsdt->signature)); /* XSDT points to both the FADT and the MADT, so add one entry */ xsdt->length = sizeof(struct xsdt_descriptor_rev2) + sizeof(u64); xsdt->revision = 1; - strlcpy(xsdt->oem_id, "XEN", sizeof(xsdt->oem_id)); - strlcpy(xsdt->oem_table_id, "Xen/ia64", sizeof(xsdt->oem_table_id)); - strlcpy(xsdt->asl_compiler_id, "XEN", sizeof(xsdt->asl_compiler_id)); + safe_strcpy(xsdt->oem_id, "XEN"); + safe_strcpy(xsdt->oem_table_id, "Xen/ia64"); + safe_strcpy(xsdt->asl_compiler_id, "XEN"); xsdt->asl_compiler_revision = (xen_major_version() << 16) | xen_minor_version();
In my patch, safe_strcpy() is gone. And anyway, if safe_strcpy works as expected, then apart from the return value there's no difference to strlcpy().
You're confusing the cleanups with the bugfixes. Any use of safe_strcpy() in my patch was just cleanup.
The bugfixes are on the signature fields (the first change quoted above), which I changed to use memcpy since strlcpy adds an unwanted NUL.
Aron
_______________________________________________ Xen-devel mailing list Xen-...@lists.xensource.com http://lists.xensource.com/xen-devel




