Commit b21a0212 authored by Ajo Robert's avatar Ajo Robert

Bug#23195404 EXCESSIVE MEMORY CAN BE USED BY THE QUOTE()

			  STRING FUNCTION

Fix:
=======
Added code in QUOTE string function to honor max_allowed_packet.
parent 7ec26b03
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -3649,6 +3649,17 @@ String *Item_func_quote::val_str(String *str)
*to= '\'';
ret:
if (new_length > current_thd->variables.max_allowed_packet)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER_THD(current_thd, ER_WARN_ALLOWED_PACKET_OVERFLOWED),
func_name(),
current_thd->variables.max_allowed_packet);
null_value= true;
return NULL;
}
tmp_value.length(new_length);
tmp_value.set_charset(collation.collation);
null_value= 0;
......
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