From a732fbec64903006eb625c08a21c79bc4d810099 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Sat, 27 Sep 2008 13:27:51 +0800 Subject: [PATCH] --- yaml --- r: 117323 b: refs/heads/master c: 4ca846e9270f305ad19e61f6654664f31459f332 h: refs/heads/master i: 117321: a302072ee1b2f54425809915bef1c34ce4d1fce2 117319: 3cdb0ecb961a6a23fcf332f4cd9c9f0f9406689b v: v3 --- [refs] | 2 +- trunk/drivers/acpi/executer/exconvrt.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 4d02f3f91a1e..a39eb344adf7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e8707b340fb5b6313cde784b944a568dfd770ddd +refs/heads/master: 4ca846e9270f305ad19e61f6654664f31459f332 diff --git a/trunk/drivers/acpi/executer/exconvrt.c b/trunk/drivers/acpi/executer/exconvrt.c index 890378e789a4..1d1f35adddde 100644 --- a/trunk/drivers/acpi/executer/exconvrt.c +++ b/trunk/drivers/acpi/executer/exconvrt.c @@ -512,9 +512,14 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, /* * Create a new string object and string buffer * (-1 because of extra separator included in string_length from above) + * Allow creation of zero-length strings from zero-length buffers. */ + if (string_length) { + string_length--; + } + return_desc = acpi_ut_create_string_object((acpi_size) - (string_length - 1)); + string_length); if (!return_desc) { return_ACPI_STATUS(AE_NO_MEMORY); } @@ -537,7 +542,9 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, * Null terminate the string * (overwrites final comma/space from above) */ - new_buf--; + if (obj_desc->buffer.length) { + new_buf--; + } *new_buf = 0; break;