Skip to content
Permalink
Browse files

Copy, not reuse, string in stat() file name

  • Loading branch information...
thesephist committed Jul 24, 2019
1 parent bd45bbe commit 8d5b6edb0dd2010d2e603acd0d2f60cffa06ecaa
Showing with 3 additions and 1 deletion.
  1. +3 −1 runtime.go
@@ -391,13 +391,15 @@ func inkStat(ctx *Context, in []Value) (Value, error) {
defer ctx.Engine.Listeners.Done()

if !ctx.Engine.Permissions.Read {
statPathBase := make([]byte, 0, len(statPath))
statPathCopy := StringValue(statPathBase, statPath...)
ctx.ExecListener(func() {
_, err := evalInkFunction(cb, false, CompositeValue{
entries: ValueTable{
"type": StringValue("data"),
"data": CompositeValue{
entries: ValueTable{
"name": statPath,
"name": statPathCopy,
"len": NumberValue(0),
"dir": BooleanValue(false),
},

0 comments on commit 8d5b6ed

Please sign in to comment.
You can’t perform that action at this time.