Skip to content

Commit

Permalink
util: fix sign-conversion warning
Browse files Browse the repository at this point in the history
  • Loading branch information
dacav committed Jan 28, 2025
1 parent 5f59ec7 commit 41c8c70
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion util.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,12 @@ int get_devices_from_authfile(const cfg_t *cfg, const char *username,
#endif
}

opwfile_size = st.st_size;
if (st.st_size < 0) {
debug_dbg(cfg, "Invalid stat size for %s: %jd", cfg->auth_file,
(intmax_t) st.st_size);
goto err;
}
opwfile_size = (size_t) st.st_size;

gpu_ret = getpwuid_r(st.st_uid, &pw_s, buffer, sizeof(buffer), &pw);
if (gpu_ret != 0 || pw == NULL) {
Expand Down

0 comments on commit 41c8c70

Please sign in to comment.