sciter-sdk / go-sciter

Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development
https://sciter.com
2.57k stars 268 forks source link

CRITICAL BUG in Window.call and other places #203

Closed c-smile closed 5 years ago

c-smile commented 5 years ago

https://github.com/sciter-sdk/go-sciter/blob/16890f6f182b5f716b321b684f61b11f92389339/sciter.go#L357

This:

for i := 0; i < argc; i++ {
   argv[i] = *args[i]
}

MUST be replaced by

for i := 0; i < argc; i++ {
   argv[i].Assign(args[i]);
}

Original version creates two copies of the same VALUE structure that are freed separately causing double deletion of the same entity.

Please check other potential places.

VALUEs can be copied only by ValueCopy() Sciter API function.

c-smile commented 5 years ago

I've uploaded fix of Window.call(), take latest version.

Other similar places (if any) need to be investigated too.

c-smile commented 5 years ago

https://github.com/sciter-sdk/go-sciter/commit/53071928badcbc38d3ed0ee45a18e93cd158088b