[ruby-cvs:50997] nobu:r43853 (trunk): file.c: fix buffer overflow

nobu at ruby-lang.org nobu at ruby-lang.org
Tue Nov 26 16:30:38 JST 2013


nobu	2013-11-26 16:30:37 +0900 (Tue, 26 Nov 2013)

  New Revision: 43853

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43853

  Log:
    file.c: fix buffer overflow
    
    * file.c (rb_readlink): fix buffer overflow on a long symlink. since
      rb_str_modify_expand() expands from its length but not its capacity,
      need to set the length properly for each expansion.
      [ruby-core:58592] [Bug #9157]

  Modified files:
    trunk/ChangeLog
    trunk/file.c
    trunk/test/ruby/test_file_exhaustive.rb


More information about the ruby-cvs mailing list