puppetlabs/puppet — pull request #2290 by Iristyle (2014-01-23 01:04:22+00:00)
Title: PUP-1494 Guard against Win32 memory corruption from Ruby .encode('UTF-16LE')

Ruby's .encode(UTF-16LE) call on String may generate a string that
not properly terminated with 2 NULLs, which may result in garbage
bytes read from the memory pointer passed into the Win32 API. This
can cause memory instability which results in failures in later
Win32 calls. These calls have been replaced with an internal
helper that properly NULl terminates the string. Note that this
bug is fixed in Ruby 2.1:
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=41920&view=revision