kralhakan2009 1
kralhakan2009
Bodyguardd 1
Bodyguardd
Vahsi Uzman 1
Vahsi Uzman
[DEV]AB 1
[DEV]AB
R 1
Roksam
noisiv 1
noisiv
Manwe Work 1
Manwe Work
Hikaye Ekle

ShopEx Buffer Overflow Fix

  • Konuyu başlatan Konuyu başlatan Luigina
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 9
  • Görüntüleme Görüntüleme 2K
Hello community !

I found an issue when i was checking ShopEx system. If your pack_tab size is bigger than default m2 / SHOP_HOST_ITEM_MAX_NUM is bigger than default this overflow occurs.
This causes a core crash as seen in the screenshot below:



Solution

I use temp buffer for handle better but you can change 8096 too.

To solve this problem, you can follow these steps:

C++:
// In shopEx.cpp

--------------------------------------------------------------
// Search

    char temp[8096];
    char* buf = &temp[0];
    size_t size = 0;

// Change like this

    TEMP_BUFFER buf(16 * 1024);
--------------------------------------------------------------
// Search

        memcpy(buf, &pack_tab, sizeof(pack_tab));
        buf += sizeof(pack_tab);
        size += sizeof(pack_tab);

// Change like this

        buf.write(&pack_tab, sizeof(pack_tab));
--------------------------------------------------------------
// Search

    pack.size = sizeof(pack) + sizeof(pack2) + size;

// Change like this

    pack.size = sizeof(pack) + sizeof(pack2) + buf.size();
--------------------------------------------------------------
// Search
 
    ch->GetDesc()->Packet(temp, size);

// Change like this


    ch->GetDesc()->Packet(buf.read_peek(), buf.size());



After following these steps, you should have overcome this problem in the ShopEx system. If you have any problems, please leave a comment.

Kind regards,

Luigina
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst