Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catching up #1285

Merged
merged 119 commits into from
Mar 6, 2021
Merged

Catching up #1285

merged 119 commits into from
Mar 6, 2021

Conversation

joligario
Copy link
Contributor

No description provided.

Kinglykrab and others added 30 commits February 2, 2021 17:06
Identify OP_ClearLeadershipAbilities/OP_ClearAA for Tit
Formatting NPC validation macro.
…ditions

[Repositories] Add expedition repositories
[Repositories] Explicitly pass database pointers to repository methods
… compilation and make things easier to maintain
noudess and others added 29 commits February 25, 2021 12:12
==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
I don't think these are actually causing any real problems, ASan
complains about them though since it's kind of a code smell I guess and
a potential source of problems. But our case is fine, so cast to silence
them.
==2317==ERROR: AddressSanitizer: heap-use-after-free on address 0x6170000633c0 at pc 0x55ed1d8e8d8b bp 0x7ffda4bef580 sp 0x7ffda4bef578
WRITE of size 8 at 0x6170000633c0 thread T0
    #0 0x55ed1d8e8d8a in Group::SetLeader(Mob*) ../zone/groups.h:80
    #1 0x55ed1d8e8d8a in Group::DisbandGroup(bool) ../zone/groups.cpp:1016

ASan didn't like this
==1810==ERROR: AddressSanitizer: strcpy-param-overlap: memory ranges [0x7ffef04baf90,0x7ffef04baf98) and [0x7ffef04baf90, 0x7ffef04baf98) overlap
    #0 0x7f163bb9509e  (/lib/x86_64-linux-gnu/libasan.so.5+0x4f09e)
    #1 0x5652caed27b3 in Client::Handle_Connect_OP_ZoneEntry(EQApplicationPacket const*) ../zone/client_packet.cpp:1535

==1918==ERROR: AddressSanitizer: strcpy-param-overlap: memory ranges [0x7ffddc8057c0,0x7ffddc8057c8) and [0x7ffddc8057c0, 0x7ffddc8057c8) overlap
    #0 0x7fc61ee0e09e  (/lib/x86_64-linux-gnu/libasan.so.5+0x4f09e)
    #1 0x56023c149698 in WorldServer::HandleMessage(unsigned short, EQ::Net::Packet const&) ../zone/worldserver.cpp:1055
This was leaking on #repop, unsure of other cases, smart pointers should
cover us though.

Direct leak of 3600 byte(s) in 18 object(s) allocated from:
    #0 0x7f2b3dbe0d30 in operator new(unsigned long) (/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x5645dc7c9dff in ZoneDatabase::LoadSpawnGroups(char const*, unsigned short, SpawnGroupList*) ../zone/spawngroup.cpp:241
    #2 0x5645dc9db3f5 in Zone::Depop(bool) ../zone/zone.cpp:1746
    #3 0x5645dca1ba6b in Zone::Repop(unsigned int) ../zone/zone.cpp:1777
    #4 0x5645db4624b7 in command_repop(Client*, Seperator const*) ../zone/command.cpp:5683

Indirect leak of 6552 byte(s) in 273 object(s) allocated from:
    #0 0x7f26f2ff8d30 in operator new(unsigned long) (/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x558d00490bc6 in __gnu_cxx::new_allocator<std::_List_node<SpawnEntry*> >::allocate(unsigned long, void const*) /usr/include/c++/8/ext/new_allocator.h:111
    #2 0x558d00490bc6 in std::allocator_traits<std::allocator<std::_List_node<SpawnEntry*> > >::allocate(std::allocator<std::_List_node<SpawnEntry*> >&, unsigned long) /usr/include/c++/8/bits/alloc_traits.h:436
    #3 0x558d00490bc6 in std::__cxx11::_List_base<SpawnEntry*, std::allocator<SpawnEntry*> >::_M_get_node() /usr/include/c++/8/bits/stl_list.h:450
    #4 0x558d00490bc6 in std::_List_node<SpawnEntry*>* std::__cxx11::list<SpawnEntry*, std::allocator<SpawnEntry*> >::_M_create_node<SpawnEntry* const&>(SpawnEntry* const&) /usr/include/c++/8/bits/stl_list.h:642
    #5 0x558d00490bc6 in void std::__cxx11::list<SpawnEntry*, std::allocator<SpawnEntry*> >::_M_insert<SpawnEntry* const&>(std::_List_iterator<SpawnEntry*>, SpawnEntry* const&) /usr/include/c++/8/bits/stl_list.h:1903
    #6 0x558d00490bc6 in std::__cxx11::list<SpawnEntry*, std::allocator<SpawnEntry*> >::push_back(SpawnEntry* const&) /usr/include/c++/8/bits/stl_list.h:1220
    #7 0x558d00490bc6 in SpawnGroup::AddSpawnEntry(SpawnEntry*) ../zone/spawngroup.cpp:122
    #8 0x558d00490bc6 in ZoneDatabase::LoadSpawnGroups(char const*, unsigned short, SpawnGroupList*) ../zone/spawngroup.cpp:291
    #9 0x558d006a1465 in Zone::Depop(bool) ../zone/zone.cpp:1746
    #10 0x558d006e1adb in Zone::Repop(unsigned int) ../zone/zone.cpp:1777
This wasn't called anywhere and was throwing format-overflow warnings
This is still less than ideal, but client's name restrictions should
prevent this from being an actual problem
[Crash] Fix ReloadQuest on Shutdown crash related to encounters
[ASan] Make Client::Clearance less gross
[Bug Fix] Do not summon pet or set new pet state when PC summoned by a mob
[Quest API] Add GetHateClosest() and GetHateListByDistance(distance) to Perl and Lua.
…pLFP

[ASan] Fix stack-buffer-overflow thanks to StopLFP
[ASan] Use casts to silence ASan complaints
…onsistency

[Bugfix] Fix Skill Caps Loading References
[ASan] Fix heap-use-after-free issue with groups
[Leak] Port SpawnGroup stuff to unique_ptr to fix leak
[Cleanup] Make code -Wformat-overflow safe
…adershipInfo

[ASan] Fix strcpy-param-overlap with GetGroupLeadershipInfo calls
@joligario joligario merged commit ec8d22c into tds_client Mar 6, 2021
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.

8 participants