Commit fa2e68aa authored by Sergei Golubchik's avatar Sergei Golubchik

main.partition_myisam crashes in embedded.

long error message with %M fails the assertion in my_vsnprintf
parent 6ac52386
...@@ -670,20 +670,21 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, ...@@ -670,20 +670,21 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
int larg= va_arg(ap, int); int larg= va_arg(ap, int);
to= process_int_arg(to, end, 0, larg, 'd', print_type); to= process_int_arg(to, end, 0, larg, 'd', print_type);
width-= (to - org_to); width-= (to - org_to);
if ((end - to) >= 4 && (int) width >= 4) if ((end - to) >= 3 && (int) width >= 3)
{ {
char errmsg_buff[MYSYS_STRERROR_SIZE]; char errmsg_buff[MYSYS_STRERROR_SIZE];
*to++= ' '; *to++= ' ';
*to++= '"'; *to++= '"';
my_strerror(errmsg_buff, sizeof(errmsg_buff), larg); my_strerror(errmsg_buff, sizeof(errmsg_buff), larg);
to= process_str_arg(cs, to, end, width-3, errmsg_buff, print_type); to= process_str_arg(cs, to, end, width-3, errmsg_buff, print_type);
*to++= '"'; if (end > to)
*to++= '"';
} }
continue; continue;
} }
/* We come here on '%%', unknown code or too long parameter */ /* We come here on '%%', unknown code or too long parameter */
if (to == end) if (to >= end)
break; break;
*to++='%'; /* % used as % or unknown code */ *to++='%'; /* % used as % or unknown code */
} }
......
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