Commit 42501173 authored by mithun's avatar mithun

Bug #16978278 : BUFFER OVERFLOW WHEN PRINTING A LARGE 64-BIT INTEGER

                WITH MY_B_VPRINTF()
Issue         : In LP 64 machine max long value can be 20 digit
                decimal value. But in my_b_vprintf() the intermediate
                buffer storage used is 17 bytes length. This will lead to
                buffer overflow.
Solution      : Increased the buffer storage from 17 to 32 bytes.
                code is backported from 5.6


mysys/mf_iocache2.c:
  In function my_b_vprintf increased the size of local buff from 17 to
  32 bytes.
parent aff9f262
...@@ -415,7 +415,7 @@ size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) ...@@ -415,7 +415,7 @@ size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
{ {
register int iarg; register int iarg;
size_t length2; size_t length2;
char buff[17]; char buff[32];
iarg = va_arg(args, int); iarg = va_arg(args, int);
if (*fmt == 'd') if (*fmt == 'd')
...@@ -450,7 +450,7 @@ size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) ...@@ -450,7 +450,7 @@ size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args)
{ {
register long iarg; register long iarg;
size_t length2; size_t length2;
char buff[17]; char buff[32];
iarg = va_arg(args, long); iarg = va_arg(args, long);
if (*++fmt == 'd') if (*++fmt == 'd')
......
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