Jump to content

Recommended Posts

Hey i get following error after creation of a new Guild:

Spoiler

EscapeString: FATAL ERROR!! not enough buffer size (dstSize 25 srcSize 13 src: Teste)

 

The code looks like :

Spoiler

    static char __escape_name[GUILD_NAME_MAX_LEN * 2 + 1];
    DBManager::instance().EscapeString(__escape_name, sizeof(__escape_name), static_cast<const char *>(gcp.name), sizeof(gcp.name));
    std::auto_ptr<SQLMsg> pmsg(DBManager::instance().DirectQuery("SELECT COUNT(*) FROM guild%s WHERE name = '%s'", get_table_postfix(), __escape_name));
    if (pmsg->Get()->uiNumRows > 0)

 

Does anyone got a idea how to fix this error ?

Link to comment
https://metin2.dev/topic/15397-guild-creatin-error/
Share on other sites

  • Premium

If you use that fix for guild sql inject you have to remove it, it already have    if (!check_name(gcp.name)) that doesn't allow more than A-Z. So the fix isn't necesary. If you are worried about that sql inject, it is just from messenger.

  • Love 1
Link to comment
https://metin2.dev/topic/15397-guild-creatin-error/#findComment-86462
Share on other sites

  • Premium

dst size: 12*2+1=25

src size: 13*2+1=27

vAyl2CH.png

maybe:

sizeof(gcp.name)

replace:

strlen(gcp.name)

 

Oh i forgot:

This """fix""" is a bullshit. Such as Sebastian said.

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/15397-guild-creatin-error/#findComment-86466
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.