Skip to content
Snippets Groups Projects
Commit a31a587b authored by Kevin P. Fleming's avatar Kevin P. Fleming
Browse files

issue #5035

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 1fb64fa4
Branches
Tags
No related merge requests found
2005-11-15 Kevin P. Fleming <kpfleming@limerick.digium.com> 2005-11-15 Kevin P. Fleming <kpfleming@limerick.digium.com>
* astmm.c (__ast_vasprintf): don't re-use the ap list without copying it; that's not safe on some platforms (issue #5035)
* doc/README.backtrace: add note about properly building Asterisk to be able to produce backtraces; wrap text and remove DOS line endings * doc/README.backtrace: add note about properly building Asterisk to be able to produce backtraces; wrap text and remove DOS line endings
* channels/chan_sip.c (add_codec_to_sdp): add 'annexb=no' to G.729A SDP (issue #5539) * channels/chan_sip.c (add_codec_to_sdp): add 'annexb=no' to G.729A SDP (issue #5539)
......
...@@ -254,21 +254,20 @@ char *__ast_strndup(const char *s, size_t n, const char *file, int lineno, const ...@@ -254,21 +254,20 @@ char *__ast_strndup(const char *s, size_t n, const char *file, int lineno, const
int __ast_vasprintf(char **strp, const char *fmt, va_list ap, const char *file, int lineno, const char *func) int __ast_vasprintf(char **strp, const char *fmt, va_list ap, const char *file, int lineno, const char *func)
{ {
int n, size = strlen(fmt) + 1; int size;
if ((*strp = __ast_alloc_region(size, FUNC_VASPRINTF, file, lineno, func)) == NULL) va_list ap2;
return -1; char s;
for (;;) {
n = vsnprintf(*strp, size, fmt, ap); *strp = NULL;
if (n > -1 && n < size) va_copy(ap2, ap);
return n; size = vsnprintf(&s, 1, fmt, ap2);
if (n > -1) { /* glibc 2.1 */ va_end(ap2);
size = n+1; *strp = __ast_alloc_region(size + 1, FUNC_VASPRINTF, file, lineno, func);
} else { /* glibc 2.0 */ if (!*strp)
size *= 2; return -1;
} vsnprintf(*strp, size + 1, fmt, ap);
if ((*strp = __ast_realloc(*strp, size, file, lineno, func)) == NULL)
return -1; return size;
}
} }
static int handle_show_memory(int fd, int argc, char *argv[]) static int handle_show_memory(int fd, int argc, char *argv[])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment