1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-07-08 01:47:11 +02:00

Prevent server crash by accessing row data from MySQL result-set when there is no valid row available. Throw an error instead. Should close #25

This commit is contained in:
Sandu Liviu Catalin
2016-07-28 00:41:43 +03:00
parent 0b6f817e1f
commit 8ce40ee74c
5 changed files with 173 additions and 34 deletions

View File

@ -41,6 +41,15 @@ protected:
void ValidateCreated() const;
#endif // _DEBUG
/* --------------------------------------------------------------------------------------------
* Validate the associated result-set handle, field index and row, and throw an error if invalid.
*/
#if defined(_DEBUG) || defined(SQMOD_EXCEPTLOC)
void ValidateStepped(CCStr file, Int32 line) const;
#else
void ValidateStepped() const;
#endif // _DEBUG
/* --------------------------------------------------------------------------------------------
* Validate the associated result-set handle and field index, and throw an error if invalid.
*/
@ -59,6 +68,15 @@ protected:
const ResRef & GetCreated() const;
#endif // _DEBUG
/* --------------------------------------------------------------------------------------------
* Validate the associated result-set handle field index and row, and throw an error if invalid.
*/
#if defined(_DEBUG) || defined(SQMOD_EXCEPTLOC)
const ResRef & GetStepped(CCStr file, Int32 line) const;
#else
const ResRef & GetStepped() const;
#endif // _DEBUG
/* --------------------------------------------------------------------------------------------
* Validate the associated result-set handle and field index, and throw an error if invalid.
*/