#406 move inventory crashes when item doesn't exist in from_index slot

Closed
opened 2 years ago by image · 2 comments
image commented 2 years ago

Commands.cpp:6552 need a item null check before item->details.item_locked

    else if(sep->arg[4][0] && strncasecmp("move", sep->arg[0], 4) == 0 && sep->IsNumber(1) && sep->IsNumber(2) && sep->IsNumber(3) && sep->IsNumber(4))
    {
        int16 from_index = atoi(sep->arg[1]);
        sint16 to_slot = atoi(sep->arg[2]);
        sint32 bag_id = atol(sep->arg[3]);
        int8 charges = atoi(sep->arg[4]);
        Item* item = client->GetPlayer()->item_list.GetItemFromIndex(from_index);

        if(item->details.item_locked)
        {
            client->SimpleMessage(CHANNEL_COLOR_RED, "You cannot move the item in use.");
            return;
        }
Commands.cpp:6552 need a item null check before item->details.item_locked else if(sep->arg[4][0] && strncasecmp("move", sep->arg[0], 4) == 0 && sep->IsNumber(1) && sep->IsNumber(2) && sep->IsNumber(3) && sep->IsNumber(4)) { int16 from_index = atoi(sep->arg[1]); sint16 to_slot = atoi(sep->arg[2]); sint32 bag_id = atol(sep->arg[3]); int8 charges = atoi(sep->arg[4]); Item* item = client->GetPlayer()->item_list.GetItemFromIndex(from_index); if(item->details.item_locked) { client->SimpleMessage(CHANNEL_COLOR_RED, "You cannot move the item in use."); return; }
devn00b commented 2 years ago
Owner

Fixed pending git update.

Fixed pending git update.
devn00b commented 2 years ago
Owner

54a61e0c39

I've seen, nor heard any further issues from this patch, closing related issues. I Will re-open if some problem pops back up.

https://git.eq2emu.com/devn00b/EQ2EMu/commit/54a61e0c391817e2e01cb5f93bc9fd8c13526afa I've seen, nor heard any further issues from this patch, closing related issues. I Will re-open if some problem pops back up.
Sign in to join this conversation.
Loading...
Cancel
Save
There is no content yet.