[ASan] Fix stack-buffer-overflow thanks to StopLFP#1275
Merged
Conversation
==1674==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffb47f3068 at pc 0x7f64ee1f531e bp 0x7fffb47f2f50 sp 0x7fffb47f2700
READ of size 432 at 0x7fffb47f3068 thread T0
#0 0x7f64ee1f531d (/lib/x86_64-linux-gnu/libasan.so.5+0x3f31d)
#1 0x55c78e8d002e in WorldServer::UpdateLFP(unsigned int, unsigned char, unsigned char, unsigned int, unsigned int, unsigned int, char const*, GroupLFPMemberEntry*) ../zone/worldserver.cpp:3166
#2 0x55c78e8d01d9 in WorldServer::StopLFP(unsigned int) ../zone/worldserver.cpp:3180
joligario
approved these changes
Feb 28, 2021
Akkadius
reviewed
Mar 1, 2021
| GroupLFPMemberEntry LFPMembers; | ||
| UpdateLFP(LeaderID, LFPOff, 0, 0, 0, 0, "", &LFPMembers); | ||
| GroupLFPMemberEntry LFPMembers[MAX_GROUP_MEMBERS]; | ||
| UpdateLFP(LeaderID, LFPOff, 0, 0, 0, 0, "", LFPMembers); |
Contributor
There was a problem hiding this comment.
There a reason we're no longer passing by reference here ?
Contributor
Author
There was a problem hiding this comment.
Arrays decay to pointers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.