New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash caused by C4Script #79

Closed
bratkartoff opened this Issue Jan 5, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@bratkartoff
Copy link

bratkartoff commented Jan 5, 2019

The following code causes a crash on Openclonk 9.0 (Windows), Openclonk 8.1 Linux (and on Clonk Rage as well)

private func Initialize() {
Test([[]]);
}

private func Test(a) {
if (GetType(a) == C4V_Int)
return 0;
SetLength(a, 1);
Test(a[0]);
return 0;
}

Edit: Test map
Crashtest.ocs.zip

@isilkor isilkor self-assigned this Jan 5, 2019

@isilkor

This comment has been minimized.

Copy link
Contributor

isilkor commented Jan 5, 2019

Testcase can be reduced to
func f() { SetLength(nil, 0); }. SetLength always crashes when the first parameter is nil.

isilkor added a commit to isilkor/openclonk that referenced this issue Jan 5, 2019

Script: Test SetLength parameter 0 for nil (GH openclonk#79)
SetLength didn't check whether its first parameter was valid, and
attempted to dereference a NULL pointer when passed nil.

isilkor added a commit that referenced this issue Jan 5, 2019

Merge pull request #80 from isilkor/check-setlength-parameter-for-nil
Script: Test SetLength parameter 0 for nil (GH #79)
@isilkor

This comment has been minimized.

Copy link
Contributor

isilkor commented Jan 5, 2019

Fixed in #80.

@isilkor isilkor closed this Jan 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment