8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 10:03:03 +01:00

Fix for CORE-1051: Possible stack corruption in DFW\check_dependencies

This commit is contained in:
hvlad 2006-12-11 14:03:29 +00:00
parent 0c4ccc148e
commit a810712c6e
3 changed files with 8 additions and 5 deletions

View File

@ -1232,8 +1232,8 @@ static void check_dependencies(thread_db* tdbb,
Database* dbb = tdbb->tdbb_database;
int i;
SLONG dep_counts[obj_count];
for (i = 0; i < obj_count; i++)
SLONG dep_counts[obj_type_MAX];
for (i = 0; i < obj_type_MAX; i++)
dep_counts[i] = 0;
if (field_name)
@ -1293,7 +1293,7 @@ static void check_dependencies(thread_db* tdbb,
REQUEST(irq_ch_dpd) = request;
}
for (i = 0; i < obj_count; i++) {
for (i = 0; i < obj_type_MAX; i++) {
if (dep_counts[i])
{
ISC_STATUS obj_type;

View File

@ -38,7 +38,7 @@ const int obj_exception = 7;
const int obj_user = 8;
const int obj_field = 9;
const int obj_index = 10;
const int obj_count = 11;
// const int obj_count = 11;
const int obj_user_group = 12;
const int obj_sql_role = 13;
const int obj_generator = 14;
@ -46,5 +46,8 @@ const int obj_udf = 15;
const int obj_blob_filter = 16;
const int obj_collation = 17;
// keep this last !
const int obj_type_MAX = 18;
#endif /* JRD_OBJ_H */

View File

@ -79,7 +79,7 @@ TYPE ("EXCEPTION", obj_exception, nam_obj_type)
TYPE ("USER", obj_user, nam_obj_type)
TYPE ("FIELD", obj_field, nam_obj_type)
TYPE ("INDEX", obj_index, nam_obj_type)
TYPE ("DEPENDENT_COUNT", obj_count, nam_obj_type)
// TYPE ("DEPENDENT_COUNT", obj_count, nam_obj_type)
TYPE ("USER_GROUP", obj_user_group, nam_obj_type)
TYPE ("ROLE", obj_sql_role, nam_obj_type)
TYPE ("GENERATOR", obj_generator, nam_obj_type)