Skip to content

Cast to correct data type to avoid memory corruption#1742

Merged
keneanung merged 5 commits intoMudlet:developmentfrom
keneanung:FixDecompressionError
Jun 7, 2018
Merged

Cast to correct data type to avoid memory corruption#1742
keneanung merged 5 commits intoMudlet:developmentfrom
keneanung:FixDecompressionError

Conversation

@keneanung
Copy link
Copy Markdown
Member

Brief overview of PR changes/additions

This fixes a memory corruption on Windows when compiling Mudlet with MinGW 5.3. It might have been a problem on other platforms as well, but it became apparent on Windows with #1176. The memory corruption is triggered in the linked issue by denying the telnet subnegotiation for ATCP. The cast from char to int lead to a change at a negative index in a bool array which happened to modify the internal state of zlib which in turn lead to a segfault or faulty state (which stalled).

Motivation for adding to Mudlet

We can switch to an updated Qt version on Windows!

Other info (issues closed, discussion etc)

Fixes #1176

@keneanung keneanung requested a review from a team as a code owner June 7, 2018 07:43
@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Jun 7, 2018

Could you enable the Qt 5.9 build here for testing?

@keneanung keneanung requested a review from a team June 7, 2018 08:18
@keneanung
Copy link
Copy Markdown
Member Author

Done

Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work! 🎉 thanks for pinning down this difficult issue 😄

keneanung added 2 commits June 7, 2018 12:52
We only build one Qt version, so the condition is unnecessary.
@keneanung keneanung merged commit d3a925e into Mudlet:development Jun 7, 2018
@keneanung keneanung deleted the FixDecompressionError branch June 7, 2018 12:21
@SlySven
Copy link
Copy Markdown
Member

SlySven commented Jun 8, 2018

Just to check - what is the earliest Qt version that we are to support - and do we still test against it?

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Jun 8, 2018

At the moment, it is 5.6, and yes Travis checks builds against it.

We can use 5.9 features just fine now because official Windows binary uses 5.9, macOS uses 5.11, and Linux uses 5.9.

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Jun 8, 2018

Just #ifdef Qt 5.9 things for now.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connecting to LOTJ on Windows with Mudlet MinGW 5.3 with GMCP on crashes/stalls in decoding MCCP

4 participants