]> git.wincent.com - mkdtemp.git/commit
Don't write directly to Ruby String object storage
authorWincent Colaiuta <win@wincent.com>
Sun, 6 Dec 2009 13:26:11 +0000 (14:26 +0100)
committerWincent Colaiuta <win@wincent.com>
Sun, 6 Dec 2009 13:26:11 +0000 (14:26 +0100)
commit90012fdb50c121b42a67b2c56e5e016cffcf3352
tree31f47afa45d19e91bb39e4044a24a0f302f90672
parent435ec9c9b3290acd602d55aa0290064f5f02f426
Don't write directly to Ruby String object storage

Rather than overwriting part of the buffer that Ruby uses to store the
template String, create a temporary C string for use with mkdtemp.

In practice, there has never been a problem with this kind of direct
manipulation of Ruby String storage with any version of Ruby that I have
tested, but just to be future-proof we err on the side of caution here.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
ext/mkdtemp.c