Skip to content

Conversation

@S1gmaToeSniffer420
Copy link

line 388 was using a single assignment operator opposed to a comparison operator.
this made it so that pLabel was never initialized, leaving m_playerName as null.

…g comparison (==) instead of assignment (=),

leaving pLabel uninitialized and m_playerName as null.
@S1gmaToeSniffer420
Copy link
Author

again, sorry for the confusion earlier.

@zackgood991
Copy link

They look the same to me...

@S1gmaToeSniffer420
Copy link
Author

the assignment using = silently fails when GetFreeVoiceLabel() returns NULL, and later code might assume pLabel was initialized, making a null pointer deref.

@a1batross
Copy link
Collaborator

You sure about that?

Because that's not how the assignment in if works. pLabel does get assigned to whatever the function returns and then gets compared for non-zero value. If the function returns NULL, pLabel becomes NULL and the branch won't execute.

Aside from dubious readability of this trick, it's harmless.

@S1gmaToeSniffer420
Copy link
Author

i mean, when i first ported the client to OpenBSD, it would always crash. but after debugging it, i changed it, and for some reason, it would not crash anymore. i probably fixed something else.
would it be useful if i were to replicate the crash again?

@a1batross
Copy link
Collaborator

When the engine crashes, it shows the backtrace info.

You could as well run it under GDB and to see why it crashes in more detail.

@S1gmaToeSniffer420
Copy link
Author

alright, i'll get back to you once i've replicated it.

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.

3 participants