pikelang / Pike

Pike is a dynamic programming language with a syntax similar to Java and C. It is simple to learn, does not require long compilation passes and has powerful built-in data types allowing simple and really fast data manipulation.
http://pike.lysator.liu.se/
Other
194 stars 34 forks source link

Pop args in getxattr() #42

Closed Frigolit closed 11 months ago

Frigolit commented 11 months ago

This fixes a memory corruption bug when using getxattr().

"#" + getxattr("/", "invalid"); would result in "invalid0" instead of the expected "#0". In the case of a valid xattr the 0 would've simply been the value, but the "#" would've been replaced with the xattr name still.

Stdio.File()->getxattr() doesn't appear to behave the same way, but it seems to me like pop_n_elems(args) should be in there as well.

grubba commented 11 months ago

The difference in behavior is likely due to getxattr() being an efun.

grubba commented 11 months ago

Cf Pike issue #10132 and commit 79c308530567028d519a48b70f470c7f2ff2a3c4.

Fixed the efun issue in Pike 7.8, 8.0 and master.

Frigolit commented 11 months ago

Awesome, thank you :)