summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 7738349c742..2812a92497f 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -201,7 +201,9 @@ net_printf(THD *thd, uint errcode, ...)
#ifndef EMBEDDED_LIBRARY
text_pos=(char*) net->buff + head_length + offset + 1;
#endif
- (void) vsprintf(my_const_cast(char*) (text_pos),format,args);
+ (void) my_vsnprintf(my_const_cast(char*) (text_pos),
+ (char*)net->buff_end-text_pos,
+ format,args);
length=(uint) strlen((char*) text_pos);
if (length >= sizeof(net->last_error))
length=sizeof(net->last_error)-1; /* purecov: inspected */