BurntSushi / regex-automata

A low level regular expression library that uses deterministic finite automata.
The Unlicense
351 stars 26 forks source link

ByteOrder::read_uint looks incorrect for big endian #19

Closed tmandry closed 1 year ago

tmandry commented 3 years ago

This code doesn't look correct for big endian:

https://github.com/BurntSushi/regex-automata/blob/8deb0dba13b72a2234830e08c1e6de2a1189bc8c/src/byteorder.rs#L37-L41

It always copies the bytes to the beginning of the 8-byte array, but then interprets them as whatever endianness is being used.

The byteorder crate copies bytes to the end for big endian.

(This issue came up in code review, not from hitting any actual bugs.)

BurntSushi commented 1 year ago

Thanks, this should be fixed in regex-automata 0.3.