Commit fd9ec39
committed
(IAC-967) Append null terminators since it is no longer part of the data
Early ruby versions did not handle wide terminators correctly and would sometime
read past the end of the string causing segfaults. To prevent that, puppet
started embedding a wide terminator within the string. So the ruby string 'hi'
would be encoded as the three character string 'hi\0', and then that would be
encoded as UTF-16LE.
While this works, it creates ambiguity as to whether the "\0" character is part
of the data or not. For example, "hi\n\0".chop is "hi\n" whereas "hi\n".chop is
"hi", and is probably what was intended.
Ruby has since fixed its wide terminator handling, and as of Puppet 7, the
`wide_string` method no longer embeds a terminator in the string. So update the
registry module to explicitly add the terminator(s) before calling
RegSetValueExW`.1 parent ddb99e8 commit fd9ec39
1 file changed
+20
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
181 | 196 | | |
182 | 197 | | |
183 | 198 | | |
184 | 199 | | |
185 | 200 | | |
186 | | - | |
| 201 | + | |
187 | 202 | | |
188 | | - | |
189 | | - | |
190 | | - | |
| 203 | + | |
| 204 | + | |
191 | 205 | | |
192 | 206 | | |
193 | 207 | | |
| |||
209 | 223 | | |
210 | 224 | | |
211 | 225 | | |
| 226 | + | |
| 227 | + | |
212 | 228 | | |
213 | 229 | | |
214 | 230 | | |
| |||
0 commit comments