LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI. Just an X-34 landspeeder out for a drive.

Home Page:https://landsandboat.github.io/server/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› Server Crash upon New Char Create

Mortalelite opened this issue Β· comments

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my issue will be ignored.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.

OS / platform the server is running (if known)

Windows 11

Branch affected by issue

base

Steps to reproduce

With the newest update from the game. When creating a new char and attempt log in after picking starting area, server will crash. Char does save in the Database, When attempt log in again after selecting that char server will crash again. Can log into the Char on Older update just fine and no issues. I have tested this on Two different Window PC's with both updated on latest. I can log in on my main Char on the newest update fine without a server crash, it's just for anyone that is new to the server.

Expected behavior

Not have the server crash upon logging in a new created char.

Just wanted to update. I tested by disable starter CS and still crashed.

Can confirm, also does it for me as well.

Also occurring for me on a fresh build/install on latest.

Can you try this patch? my setup is in some super jank state where I can't easily undo my db edits (some fields are gone/changed)

diff --git a/src/common/database.h b/src/common/database.h
index d00b320701..f0117823ea 100644
--- a/src/common/database.h
+++ b/src/common/database.h
@@ -270,9 +270,12 @@ namespace db
 
         TracyZoneScoped;
 
-        auto blobStr = rset->getString(blobKey.c_str());
-        std::memset(&destination, 0x00, sizeof(T));
-        std::memcpy(&destination, blobStr.c_str(), sizeof(T));
+        if (!rset->isNull(blobKey.c_str())) // This can do very bad things if the blob is NULL.
+        {
+            auto blobStr = rset->getString(blobKey.c_str());
+            std::memset(&destination, 0x00, sizeof(T));
+            std::memcpy(&destination, blobStr.c_str(), sizeof(T));
+        }
     }
 
     // @brief Execute a query with the given query string.

Just tested, the patch allowed me to log into a new char without crashing map.exe. Anything else you want me to try out/test?

Nah that's good enough, thanks