Bugzilla – Bug 585
Incorrect zero-length Buffer to String conversion
Last modified: 2008-09-26 19:55:55
You need to log in before you can comment on or make changes to this bug.
Neither ToDecimalString and ToHexString reference nor the Buffer to String conversion rule (Table 17-8 Object Conversion Rules) describes the result of their use for a zero-length Buffer. Apparently a zero length string looks like a natural result there. The attached demo shows that a zero-length Buffer to String conversion is implemented incorrectly now (the results of conversion differ from a zero length string). INTERNAL BUG NUMBER: 293
Created an attachment (id=630) [details] ASL code to reproduce the bug
Possible fix: +++ exconvrt.c 2007-01-31 15:25:46.573712500 +0300 @@ -638,7 +638,11 @@ AcpiExConvertToString ( * Create a new string object and string buffer * (-1 because of extra separator included in StringLength from above) */ - ReturnDesc = AcpiUtCreateStringObject ((ACPI_SIZE) (StringLength - 1)); + if (StringLength) + { + StringLength--; + } + ReturnDesc = AcpiUtCreateStringObject ((ACPI_SIZE) StringLength); if (!ReturnDesc) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -662,7 +666,9 @@ AcpiExConvertToString ( * Null terminate the string * (overwrites final comma/space from above) */ - NewBuf--; + if (ObjDesc->Buffer.Length) { + NewBuf--; + } *NewBuf = 0; break;
Windows doesn't support converting zero-length Buffer
ship in ACPICA release 20080926