Skip to content

Commit

Permalink
Fix getpwnam_r size check
Browse files Browse the repository at this point in the history
Co-authored-by: Nobuyoshi Nakada <nobu.nakada@gmail.com>
  • Loading branch information
jeremyevans and nobu authored Nov 20, 2024
1 parent 177ded8 commit 79ea138
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/etc/etc.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ etc_getpwnam(VALUE obj, VALUE nam)
return Qnil;
}

if (enm != ERANGE || bufsizenm >= GETPW_R_SIZE_LIMIT) {
if (enm != ERANGE || args.bufsize >= GETPW_R_SIZE_LIMIT) {
rb_str_resize(getpwnm_tmp, 0);
rb_syserr_fail(enm, "getpwnam_r");
}
Expand Down

0 comments on commit 79ea138

Please sign in to comment.