unix_timestamp() fix for MariaDB
MariaDB returns NULL instead of 0 when an argument is passed that is out of range
(https://mariadb.com/kb/en/unix_timestamp/) When the column 'suspendeduntil' of an entry in the 'account' table is out of range (e.g., the default value '0000-00-00 00:00:00'), undefined behavior results in Database::CheckStatus() from common/database.cpp since it essentially calls atoi(NULL), which generally causes a segfault. I added a simple check for this, here is the diff: Code:
--- database.cpp 2013-09-27 22:50:21.412193740 -0700 Edit: Forgot EQEmu is on GitHub, I'll make an account and create a pull request when I have time. Edit 2: Okay, done. |
All times are GMT -4. The time now is 10:46 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.