Bug 65078 - Reading/writing sized uints that are in Big Endian is broken
Summary: Reading/writing sized uints that are in Big Endian is broken
Status: RESOLVED FIXED
Alias: None
Product: libqmi
Classification: Unclassified
Component: libqmi (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Dan Williams
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-28 13:33 UTC by Aleksander Morgado
Modified: 2013-05-31 06:16 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch for the issue. (12.58 KB, patch)
2013-05-28 13:36 UTC, Aleksander Morgado
Details | Splinter Review

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.