From f289dffc488bc8890ca1bf63b67ad265c28b178a Mon Sep 17 00:00:00 2001 From: Vexyl Date: Sat, 28 Sep 2013 10:38:50 -0700 Subject: [PATCH] Fix for segfault in Database::CheckStatus() when using MariaDB. --- common/database.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index e856175a4..8559bc940 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -304,7 +304,11 @@ int16 Database::CheckStatus(uint32 account_id) int16 status = atoi(row[0]); - int32 suspendeduntil = atoi(row[1]); + int32 suspendeduntil = 0; + // MariaDB initalizes with NULL if unix_timestamp() is out of range + if (row[1] != NULL) { + suspendeduntil = atoi(row[1]); + } int32 current = atoi(row[2]);