Index: client/openssh/xmalloc.c =================================================================== --- client/openssh/xmalloc.c (revision 30927) +++ client/openssh/xmalloc.c (arbetskopia) @@ -79,6 +79,18 @@ return cp; } +static inline int myvasprintf(char **PTR, const char *TEMPLATE, va_list AP) +{ + int res; + char buf[16000]; + res = vsnprintf(buf, 16000, TEMPLATE, AP); + if (res > 0) { + *PTR = (char*)malloc(res + 1); + res = vsnprintf(*PTR, res + 1, TEMPLATE, AP); + } + return res; +} + int xasprintf(char **ret, const char *fmt, ...) { @@ -86,7 +98,7 @@ int i; va_start(ap, fmt); - i = vasprintf(ret, fmt, ap); + i = myvasprintf(ret, fmt, ap); va_end(ap); if (i < 0 || *ret == NULL)