Skip to content

Commit 322afb2

Browse files
author
Kailasnath Nagarkar
committed
Bug #19984392 : MEDIUMINT: STACK BUFFER OVERFLOW IN PROTOCOL_TEXT::STORE_LONG
ISSUE: Queries with mediumint as column when operated with long long type of data results in buffer overflow in store_long function. The merging rule specified for (MYSQL_TYPE_LONGLONG MYSQL_TYPE_INT24) is MYSQL_TYPE_LONG. Due to this store_long function was getting called which resulted in buffer overflow. SOLUTION: The correct merging rule for (MYSQL_TYPE_LONGLONG, MYSQL_TYPE_INT24) should be MYSQL_TYPE_LONGLONG. So, instead of function store_long, function store_longlong is called which correctly handles the type MYSQL_TYPE_LONGLONG. External Bug #23645238 is a duplicate of this issue.
1 parent 8bb95e9 commit 322afb2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/field.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -347,7 +347,7 @@ static enum_field_types field_types_merge_rules [FIELDTYPE_NUM][FIELDTYPE_NUM]=
347347
//MYSQL_TYPE_NULL MYSQL_TYPE_TIMESTAMP
348348
MYSQL_TYPE_LONGLONG, MYSQL_TYPE_VARCHAR,
349349
//MYSQL_TYPE_LONGLONG MYSQL_TYPE_INT24
350-
MYSQL_TYPE_LONGLONG, MYSQL_TYPE_LONG,
350+
MYSQL_TYPE_LONGLONG, MYSQL_TYPE_LONGLONG,
351351
//MYSQL_TYPE_DATE MYSQL_TYPE_TIME
352352
MYSQL_TYPE_VARCHAR, MYSQL_TYPE_VARCHAR,
353353
//MYSQL_TYPE_DATETIME MYSQL_TYPE_YEAR

0 commit comments

Comments
 (0)