Commit 5d9e50fc authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-4244 [PATCH] Buffer overruns and use-after-free errors

fixes for gcc 4.8 -fsanitize=address
parent 6770a9a8
...@@ -1632,7 +1632,7 @@ int DsMrr_impl::dsmrr_explain_info(uint mrr_mode, char *str, size_t size) ...@@ -1632,7 +1632,7 @@ int DsMrr_impl::dsmrr_explain_info(uint mrr_mode, char *str, size_t size)
uint used_str_len= strlen(used_str); uint used_str_len= strlen(used_str);
uint copy_len= min(used_str_len, size); uint copy_len= min(used_str_len, size);
memcpy(str, used_str, size); memcpy(str, used_str, copy_len);
return copy_len; return copy_len;
} }
return 0; return 0;
......
...@@ -6617,20 +6617,20 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) ...@@ -6617,20 +6617,20 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
break; break;
case MYSQL_TYPE_DATE: case MYSQL_TYPE_DATE:
if (!(item=new Item_return_date_time(fields_info->field_name, if (!(item=new Item_return_date_time(fields_info->field_name,
MAX_DATE_WIDTH, strlen(fields_info->field_name),
fields_info->field_type))) fields_info->field_type)))
DBUG_RETURN(0); DBUG_RETURN(0);
break; break;
case MYSQL_TYPE_TIME: case MYSQL_TYPE_TIME:
if (!(item=new Item_return_date_time(fields_info->field_name, if (!(item=new Item_return_date_time(fields_info->field_name,
MAX_TIME_FULL_WIDTH, strlen(fields_info->field_name),
fields_info->field_type))) fields_info->field_type)))
DBUG_RETURN(0); DBUG_RETURN(0);
break; break;
case MYSQL_TYPE_TIMESTAMP: case MYSQL_TYPE_TIMESTAMP:
case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_DATETIME:
if (!(item=new Item_return_date_time(fields_info->field_name, if (!(item=new Item_return_date_time(fields_info->field_name,
MAX_DATETIME_WIDTH, strlen(fields_info->field_name),
fields_info->field_type))) fields_info->field_type)))
DBUG_RETURN(0); DBUG_RETURN(0);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment