mirror of
https://github.com/MariaDB/server.git
synced 2026-05-08 08:04:29 +02:00
Fix accesses to uninitialized memory (found by valgrind)
mysys/my_alloc.c: Added comment for free_root sql/filesort.cc: Removed valgrind warning sql/sql_select.cc: Remove not needed my_casedn_str() for internal files (Old code actually didn't do any god as it was accessing not used memory) sql/sql_view.cc: Removed access to uninitialized memory sql/table.cc: Cleanup of error handling
This commit is contained in:
parent
a21bb57546
commit
90b9065dce
5 changed files with 71 additions and 54 deletions
|
|
@ -948,11 +948,12 @@ frm_type_enum mysql_frm_type(char *path)
|
|||
{
|
||||
DBUG_RETURN(FRMTYPE_ERROR);
|
||||
}
|
||||
length= my_read(file, (byte*) header, 10, MYF(MY_WME));
|
||||
length= my_read(file, (byte*) header, sizeof(header), MYF(MY_WME));
|
||||
my_close(file, MYF(MY_WME));
|
||||
if (length == (int) MY_FILE_ERROR)
|
||||
DBUG_RETURN(FRMTYPE_ERROR);
|
||||
if (!strncmp(header, "TYPE=VIEW\n", 10))
|
||||
if (length < (int) sizeof(header) ||
|
||||
!strncmp(header, "TYPE=VIEW\n", sizeof(header)))
|
||||
DBUG_RETURN(FRMTYPE_VIEW);
|
||||
DBUG_RETURN(FRMTYPE_TABLE); // Is probably a .frm table
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue