safe guards regarding checking for record objs. issue #29.
parent
e4871f5305
commit
af0a366267
|
@ -35,7 +35,8 @@ typedef size_t OFFSET;
|
|||
|
||||
#define MAX_COM_STATUS_VARS_RECORDS 512
|
||||
|
||||
#define MAX_OBJECT_CHAR_NUMBERS 130
|
||||
//mysql max identifier is 64 so 2*64 + . and null
|
||||
#define MAX_OBJECT_CHAR_NUMBERS 131
|
||||
#define MAX_USER_CHAR_NUMBERS 20
|
||||
const char * retrieve_user (THD * thd);
|
||||
#define MAX_NUM_OBJECT_ELEM 256
|
||||
|
|
|
@ -654,9 +654,12 @@ static void audit(ThdSesData *pThdData)
|
|||
while (table && !matched) {
|
||||
char *name = table->get_table_name();
|
||||
char *db = table->get_db_name();
|
||||
char db_obj[MAX_OBJECT_CHAR_NUMBERS];
|
||||
char wildcard_obj[MAX_OBJECT_CHAR_NUMBERS];
|
||||
char db_wildcard[MAX_OBJECT_CHAR_NUMBERS];
|
||||
char db_obj[MAX_OBJECT_CHAR_NUMBERS] = {0};
|
||||
char wildcard_obj[MAX_OBJECT_CHAR_NUMBERS] = {0};
|
||||
char db_wildcard[MAX_OBJECT_CHAR_NUMBERS] = {0};
|
||||
if(db && name &&
|
||||
((strlen(db) + strlen(name)) < MAX_OBJECT_CHAR_NUMBERS - 2))
|
||||
{
|
||||
strcpy(db_obj, db);
|
||||
strcat(db_obj, ".");
|
||||
strcat(db_obj, name);
|
||||
|
@ -673,6 +676,7 @@ static void audit(ThdSesData *pThdData)
|
|||
table = table->next_global;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!matched) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue