diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-01-23 19:17:13 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-01-23 19:17:13 +0100 |
commit | fa2e68aaa421a65159aaec5091e69d53dbec2eb6 (patch) | |
tree | 22476e8d03941eafaebd37c6f894d4f2fa4d4a28 /strings | |
parent | 6ac52386bbecb90dd4ceb7bd2737ef5eb7abb1ad (diff) | |
download | mariadb-git-fa2e68aaa421a65159aaec5091e69d53dbec2eb6.tar.gz |
main.partition_myisam crashes in embedded.
long error message with %M fails the assertion in my_vsnprintf
Diffstat (limited to 'strings')
-rw-r--r-- | strings/my_vsnprintf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index c38cd91e807..362dafb76ce 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -670,20 +670,21 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, int larg= va_arg(ap, int); to= process_int_arg(to, end, 0, larg, 'd', print_type); width-= (to - org_to); - if ((end - to) >= 4 && (int) width >= 4) + if ((end - to) >= 3 && (int) width >= 3) { char errmsg_buff[MYSYS_STRERROR_SIZE]; *to++= ' '; *to++= '"'; my_strerror(errmsg_buff, sizeof(errmsg_buff), larg); to= process_str_arg(cs, to, end, width-3, errmsg_buff, print_type); - *to++= '"'; + if (end > to) + *to++= '"'; } continue; } /* We come here on '%%', unknown code or too long parameter */ - if (to == end) + if (to >= end) break; *to++='%'; /* % used as % or unknown code */ } |