Bug 65078

Summary: Reading/writing sized uints that are in Big Endian is broken
Product: libqmi Reporter: Aleksander Morgado <aleksander>
Component: libqmiAssignee: Dan Williams <dcbw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: aleksander, marius
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch for the issue.

Description Aleksander Morgado 2013-05-28 13:33:21 UTC
When reading a sized Little Endian uint from a buffer, we just need to read
N bytes from the buffer and place them at the beginning of a new 8-byte buffer,
(as if it were a guint64) and finally convert from LE to HE.

But when reading a sized Big Endian uint from a buffer, the N bytes that we read from the beginning of the buffer need to be placed at the *end* of the new 8-byte buffer before converting from BE to HE.

Same when writing sized Big Endian uints.
Comment 1 Aleksander Morgado 2013-05-28 13:36:42 UTC
Created attachment 79897 [details] [review]
Patch for the issue.

Patch can be applied on top of the one for bug 64987 (issue actually found with the updated tests in that patch).

Comments?
Comment 2 Aleksander Morgado 2013-05-31 06:16:33 UTC
Patch pushed after testing ok in a mips BE system.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.