1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

main.partition_myisam crashes in embedded.

long error message with %M fails the assertion in my_vsnprintf
This commit is contained in:
Sergei Golubchik
2013-01-23 19:17:13 +01:00
parent 6ac52386bb
commit fa2e68aaa4

View File

@ -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 */
} }