[FIXED] UOX3 crashes if user opens crowded ADD-menu-section
- 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
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:
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 
- Xuri
- Site Admin
- Posts: 3704
- Joined: Mon Jun 02, 2003 9:11 am
- Location: Norway
- Has thanked: 48 times
- Been thanked: 8 times
- Contact:
This one?
Code: Select all
if( length > 65536 )
throw std::runtime_error( "Packet 0xB0 is far too large" );-= 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:
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.
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.