Closed msawahara closed 1 year ago
Hi @msawahara
Sorry for reply so late, I joined a new company not long ago, so I spend most of my time to get myself more familiar with the onboard training.
Thank you for spending time playing around with this project! The PR looks good to me, will merge after I test it on the boards I have, hopefully I can find some time to test next week :)
Hi @msawahara ,
Appreciate for the PR!
Thank you for the merging!
Hi.
I use usb-proxy to analyze USB devices and it is very useful. However, it required minor fix to use injection feature in my environment.
Problem
In aarch64, a
std::out_of_range
exception is thrown if a injection rule doesn't match.std::basic_string::find
returnsstd::string::npos
if the pattern doesn't match.std::string::npos
is18446744073709551615UL
in aarch64, but when it is assigned to__u32
, it overflows and becomes4294967295
.Fix
Use
std::string::size_type
instead of__u32
.std::string::size_type
is the correct return type forstd::basic_string::find
.Alternatively, we can use the
auto
keyword withoutstd::string::size_type
explicitly.