Skip to content

[ASan] Fix stack-buffer-overflow thanks to StopLFP#1275

Merged
KimLS merged 1 commit intomasterfrom
bug_fix/stack-buffer-overflow_StopLFP
Mar 6, 2021
Merged

[ASan] Fix stack-buffer-overflow thanks to StopLFP#1275
KimLS merged 1 commit intomasterfrom
bug_fix/stack-buffer-overflow_StopLFP

Conversation

@mackal
Copy link
Copy Markdown
Contributor

@mackal mackal commented Feb 28, 2021

==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

==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
@mackal mackal changed the title Fix stack-buffer-overflow thanks to StopLFP [ASan] Fix stack-buffer-overflow thanks to StopLFP 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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There a reason we're no longer passing by reference here ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Arrays decay to pointers.

@KimLS KimLS merged commit 184128a into master Mar 6, 2021
@mackal mackal deleted the bug_fix/stack-buffer-overflow_StopLFP branch March 6, 2021 03:51
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.

4 participants