mirror of
https://github.com/javalsai/lidm.git
synced 2026-02-27 12:00:44 +01:00
fix: pass clang-tidy
This commit is contained in:
@@ -22,6 +22,10 @@ int read_launch_state(struct LaunchState* NNULLABLE state) {
|
||||
|
||||
size_t num = 0;
|
||||
if (getline(&state->username, &num, state_fd) < 0) goto fail;
|
||||
// not sure I can actually prove it but ughh, getline < 0 will ensure there's
|
||||
// something in the string and then I think strcspn is bounded to the final
|
||||
// null byte, so it shouldn't go over
|
||||
// NOLINTNEXTLINE(clang-analyzer-security.ArrayBound)
|
||||
state->username[strcspn(state->username, "\n")] = 0;
|
||||
|
||||
num = 0;
|
||||
|
||||
Reference in New Issue
Block a user