Skip to content

Fix reading/writing string_t array netprops#1538

Merged
asherkin merged 1 commit intomasterfrom
bug-1484
Jul 18, 2021
Merged

Fix reading/writing string_t array netprops#1538
asherkin merged 1 commit intomasterfrom
bug-1484

Conversation

@asherkin
Copy link
Member

When a netprop is an array the name resolves to the outer DataTable
array, which we then need to recurse into to find the actual prop.

For string_t props we need their sendprop info to call the proxy
function to get their real storage address, but when accessing an array
we were trying to read the prop off the outer DataTable prop, rather
than the real string_t prop. Fix this by using the pProp variable that
FIND_PROP_SEND helpfully provides for us.

Tested by writing/reading the m_szCrosshairCodes array, which got
changed to a string_t prop sometime since #1372.

Fixes #1484

When a netprop is an array the name resolves to the outer DataTable
array, which we then need to recurse into to find the actual prop.

For string_t props we need their sendprop info to call the proxy
function to get their real storage address, but when accessing an array
we were trying to read the prop off the outer DataTable prop, rather
than the real string_t prop. Fix this by using the pProp variable that
FIND_PROP_SEND helpfully provides for us.

Tested by writing/reading the `m_szCrosshairCodes` array, which got
changed to a string_t prop sometime since #1372.

Fixes #1484
@asherkin asherkin requested a review from psychonic July 17, 2021 22:51
Copy link
Member

@psychonic psychonic left a comment

Choose a reason for hiding this comment

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

Good find!

@asherkin asherkin merged commit 39aa754 into master Jul 18, 2021
@asherkin asherkin deleted the bug-1484 branch July 18, 2021 01:01
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.

Crash when trying to change the "m_szCrosshairCodes" netprop

2 participants