mvp / uhubctl

uhubctl - USB hub per-port power control
Other
2.23k stars 232 forks source link

Make sure strncpy writes null-terminated strings #443

Closed real-or-random closed 2 years ago

real-or-random commented 2 years ago

This fixes UB.

Before:

> uhubctl -l 012345678901234567890123456789012 -s bar
There were permission problems while accessing USB.
Follow https://git.io/JIB2Z for a fix!
No compatible devices detected at location 01234567890123456789012345678901bar!
Run with -h to get usage info.

After:

> uhubctl -l 012345678901234567890123456789012 -s bar
There were permission problems while accessing USB.
Follow https://git.io/JIB2Z for a fix!
No compatible devices detected at location 01234567890123456789012345678901!
Run with -h to get usage info.
mvp commented 2 years ago

Thank you for your fix @real-or-random 👍