[FIXED] Targeting a non-item when releasing lockdowns crashes server

Here we stuff all the bugs we've managed to squash/squish/squelch.
Locked
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:

Targeting a non-item when releasing lockdowns crashes server

Post by Xuri »

UOX3 version: 0.98.-4.0c

If you, when trying to release a locked-down item in a house, should happen to target a non-dynamic item or a map-tile, the server will crash.

The culprit, in void HouseRelease( CSocket *s ):

Code: Select all

	if( ValidateObject( itemToLock ) [color=red]|| !itemToLock->IsLockedDown()[/color] )
Not a very good idea to put an "or" statement there that tries to check a property of the target object even though the target isn't necessarily a valid object :P Fail!

I'm not even sure that it checks correctly. It seems to check if an object is NOT locked down, and if true, it allows you to continue with the item-release? Should maybe be the other way around - check if it IS locked down? Hm.
Last edited by Xuri on Sun Jan 24, 2010 3:51 pm, edited 1 time in total.
-= 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 »

Fix for this is up on CVS.
-= 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 »

lol
Locked