Skip to content

Commit

Permalink
utils: check for snprintf truncation
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Sjölund <[email protected]>
  • Loading branch information
eriksjolund committed Oct 29, 2024
1 parent 3b31243 commit 6628d7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcrun/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ find_executable (const char *executable_path, const char *cwd)
it = ".";

len = snprintf (path, PATH_MAX, "%s/%s", it, executable_path);
if (len == PATH_MAX)
if (len >= PATH_MAX)
continue;

ret = check_access (path);
Expand Down

0 comments on commit 6628d7a

Please sign in to comment.