mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-04-09 03:00:07 +03:00
Fix CAdminData buffer overrun
Adjust admin.sma array sizes and DB sizes
This commit is contained in:
parent
9fbf91ded0
commit
6119ef7ae2
@ -286,7 +286,7 @@ public:
|
|||||||
void SetAuthID(const cell *Input)
|
void SetAuthID(const cell *Input)
|
||||||
{
|
{
|
||||||
unsigned int i=0;
|
unsigned int i=0;
|
||||||
while (i<sizeof(m_AuthData)-1)
|
while (i<arraysize(m_AuthData)-1)
|
||||||
{
|
{
|
||||||
if ((m_AuthData[i++]=*Input++)==0)
|
if ((m_AuthData[i++]=*Input++)==0)
|
||||||
{
|
{
|
||||||
@ -305,7 +305,7 @@ public:
|
|||||||
void SetPass(const cell *Input)
|
void SetPass(const cell *Input)
|
||||||
{
|
{
|
||||||
unsigned int i=0;
|
unsigned int i=0;
|
||||||
while (i<sizeof(m_Password)-1)
|
while (i<arraysize(m_Password)-1)
|
||||||
{
|
{
|
||||||
if ((m_Password[i++]=*Input++)==0)
|
if ((m_Password[i++]=*Input++)==0)
|
||||||
{
|
{
|
||||||
|
@ -207,10 +207,10 @@ public addadminfn(id, level, cid)
|
|||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
}
|
}
|
||||||
|
|
||||||
new flags[64]
|
new flags[32]
|
||||||
read_argv(2, flags, charsmax(flags))
|
read_argv(2, flags, charsmax(flags))
|
||||||
|
|
||||||
new password[64]
|
new password[32]
|
||||||
if (read_argc() >= 4) {
|
if (read_argc() >= 4) {
|
||||||
read_argv(3, password, charsmax(password))
|
read_argv(3, password, charsmax(password))
|
||||||
}
|
}
|
||||||
@ -444,7 +444,7 @@ public adminSql()
|
|||||||
|
|
||||||
query = SQL_PrepareQuery(sql, "SELECT auth, password, access, flags FROM %s", table)
|
query = SQL_PrepareQuery(sql, "SELECT auth, password, access, flags FROM %s", table)
|
||||||
} else {
|
} else {
|
||||||
SQL_QueryAndIgnore(sql, "CREATE TABLE IF NOT EXISTS `%s` ( `auth` VARCHAR( 32 ) NOT NULL, `password` VARCHAR( 32 ) NOT NULL, `access` VARCHAR( 32 ) NOT NULL, `flags` VARCHAR( 32 ) NOT NULL ) COMMENT = 'AMX Mod X Admins'", table)
|
SQL_QueryAndIgnore(sql, "CREATE TABLE IF NOT EXISTS `%s` ( `auth` VARCHAR( 43 ) NOT NULL, `password` VARCHAR( 31 ) NOT NULL, `access` VARCHAR( 31 ) NOT NULL, `flags` VARCHAR( 31 ) NOT NULL ) COMMENT = 'AMX Mod X Admins'", table)
|
||||||
query = SQL_PrepareQuery(sql,"SELECT `auth`,`password`,`access`,`flags` FROM `%s`", table)
|
query = SQL_PrepareQuery(sql,"SELECT `auth`,`password`,`access`,`flags` FROM `%s`", table)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ public adminSql()
|
|||||||
new qcolFlags = SQL_FieldNameToNum(query, "flags")
|
new qcolFlags = SQL_FieldNameToNum(query, "flags")
|
||||||
|
|
||||||
new AuthData[44];
|
new AuthData[44];
|
||||||
new Password[44];
|
new Password[32];
|
||||||
new Access[32];
|
new Access[32];
|
||||||
new Flags[32];
|
new Flags[32];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user