From d129f8ba26c5d92733c65d8e16cab4150df08f4d Mon Sep 17 00:00:00 2001 From: Carlos Corbacho Date: Thu, 13 Dec 2007 13:45:01 +0000 Subject: [PATCH] wmi-acer: More query fixes (take 3) Strange things are happening when the 'expensive' code path is taken. Use memcpy instead of strncpy to stop an overwrite of the real method. --- wmi-acer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wmi-acer.c b/wmi-acer.c index a9a6f72..c2efd82 100644 --- a/wmi-acer.c +++ b/wmi-acer.c @@ -333,8 +333,8 @@ struct acpi_buffer *out) { struct guid_block *block = NULL; struct wmi_block *wblock = NULL; - acpi_handle handle, wc_handle = NULL; - acpi_status status, wc_status; + acpi_handle handle; + acpi_status status, wc_status = AE_ERROR; struct acpi_object_list input, wc_input; union acpi_object wc_params[1], wq_params[1]; char method[4] = "WQ"; @@ -382,7 +382,7 @@ struct acpi_buffer *out) &wc_input, NULL); } - strncat(method, block->object_id, 2); + memcpy(method + 2, block->object_id, 2); DEBUG(2, "Object to call is %s\n", method); status = acpi_evaluate_object(handle, method, NULL, out); -- 2.11.4.GIT