[FIXED] UOX3 crashes if user opens crowded ADD-menu-section

Here we stuff all the bugs we've managed to squash/squish/squelch.
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

UOX3 crashes if user opens crowded ADD-menu-section

Post by Xuri »

If a section of the ADD menu contains too many items ( length > 65536 ?), UOX3 will crash when someone tries opening that section of the menu.
Last edited by Xuri on Sun Jan 18, 2009 9:51 pm, edited 3 times in total.
-= Ho Eyo He Hum =-
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

If Length is > 65536, then definitely, and there's nothing you can do about it. The packet header includes only a 2 byte length field, which means the packet just can't be physically that long. Break it up into smaller menus, though I thought that there were some placeholder checks in there to verify it wasn't too bad. Guess I was wrong :)
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

This one? :P

Code: Select all

if( length > 65536 )
	throw std::runtime_error( "Packet 0xB0 is far too large" );
-= Ho Eyo He Hum =-
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

*bump*

We need a working placeholder check to ensure that UOX3 won't crash if someone creates a too long add-menu section :P
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

We should work on incorporating zlib librarys and making use of the new packed gump packet. This should (to some extent) resolve this issue.
Scott
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

Yes, it'll help somewhat. The zip lib compressed gumps gives us an excuse to use it elsewhere potentially, as well (saves, archives, compressed dirs of DFNs, that sort of thing).

But ultimately ... the user really shouldn't be making an add menu that long. And it's either crash and burn, or not send it at all. Because if you send it, you can lead to client crashes, lockups, or for more fun, you always run the risk of corrupted data.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Invalidating this bug, since there's nothing we can do about it? and it's ultimately an issue that server admins can avoid with little effort in any case.
-= Ho Eyo He Hum =-
Post Reply