HomePhorge

(PUP-1389) Ensure wide strings have double null terminators
aead9c21ae31Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-1389) Ensure wide strings have double null terminators

It seems that calling String#encode('UTF-16LE') sometimes adds only a single
NULL terminator in both ruby 1.9 and 2.0 on Windows. However, a wide string
is supposed to have two NULL terminators.

For reasons unknown, versions prior to 2012 seem to accept wide strings with
only a single NULL terminator, but in 2012 and 2012R2 the string is often times
contains a non-zero high byte, which causes Windows to read past the single
terminator, and attempt to access a path that does not exist.

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU98e9219a4d4d: (PUP-724,#21922) Autoload compares only integer secs
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPUaead9c21ae31: (PUP-1389) Ensure wide strings have double null terminators (authored by Josh Cooper <josh@puppetlabs.com>).Jan 14 2014, 8:53 AM