summaryrefslogtreecommitdiff
path: root/innobase/dict
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-06-01 15:19:09 +0300
committerunknown <marko@hundin.mysql.fi>2004-06-01 15:19:09 +0300
commitbab2231f7112e9808a1429c1409cc610131323b5 (patch)
treeedf5227b878c8f401692637cae7a135939fcde65 /innobase/dict
parentc0b6c9f7e9067d01d1a57e21e560033b6a489ba0 (diff)
downloadmariadb-git-bab2231f7112e9808a1429c1409cc610131323b5.tar.gz
InnoDB cleanup: Fix potential buffer overflows,
allow deletion of tablespaces whose names contain "'" innobase/dict/dict0load.c: dict_check_tablespaces_or_store_max_id(): Dynamically allocate memory for file name innobase/fil/fil0fil.c: Dynamically allocate memory for file names innobase/os/os0file.c: os_file_dirname(): allocate slightly less memory os_file_create_subdirs_if_needed(): compare more efficiently innobase/row/row0mysql.c: Allow tablespaces with "'" in their names to be deleted Display identifiers with ut_print_name() or dict_index_name_print()
Diffstat (limited to 'innobase/dict')
-rw-r--r--innobase/dict/dict0load.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c
index b55050ee83f..ee4ae9dd1a1 100644
--- a/innobase/dict/dict0load.c
+++ b/innobase/dict/dict0load.c
@@ -207,7 +207,6 @@ dict_check_tablespaces_or_store_max_id(
ulint space_id;
ulint max_space_id = 0;
mtr_t mtr;
- char name[OS_FILE_MAX_PATH];
mutex_enter(&(dict_sys->mutex));
@@ -247,9 +246,7 @@ loop:
/* We found one */
- ut_a(len < OS_FILE_MAX_PATH - 10);
- ut_memcpy(name, field, len);
- name[len] = '\0';
+ char* name = mem_strdupl(field, len);
field = rec_get_nth_field(rec, 9, &len);
ut_a(len == 4);
@@ -267,7 +264,9 @@ loop:
fil_space_for_table_exists_in_mem(space_id, name,
TRUE, TRUE);
}
-
+
+ mem_free(name);
+
if (space_id > max_space_id) {
max_space_id = space_id;
}