io.c: wipe away ioctl buffer

* io.c (setup_narg): wipe away expanded part of buffer to get rid
  of revealing uncleaned data.  reported by Dongkwan Kim <dkay AT
  kaist.ac.kr>.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-02-27 04:57:51 +00:00
parent 6bb470cf80
commit d8abb9daaf
2 changed files with 7 additions and 0 deletions

1
io.c
View file

@ -9103,6 +9103,7 @@ setup_narg(ioctl_req_t cmd, VALUE *argp, int io_p)
/* expand for data + sentinel. */
if (slen < len+1) {
rb_str_resize(arg, len+1);
MEMZERO(RSTRING_PTR(arg)+slen, char, len-slen);
slen = len+1;
}
/* a little sanity check here */