diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-18 22:49:26 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-18 22:49:26 +0000 |
commit | 744136bb41f1d583f5260b3281057b49fee996d7 (patch) | |
tree | 570a5f1b4b64333fd0dc70a27b1d6c9f9fad373c | |
parent | 598b4be23ee0fa90fd4a780c1e729941b70a7e16 (diff) |
Merged revisions 263904 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r263904 | dvossel | 2010-05-18 17:48:51 -0500 (Tue, 18 May 2010) | 9 lines
fixes segfault on logging
(closes issue #17331)
Reported by: under
Patches:
utils.diff uploaded by under (license 914)
segfault_on_logging.diff uploaded by dvossel (license 671)
Tested by: under, dvossel
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@263906 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/strings.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/main/strings.c b/main/strings.c index ce1fbef45..afe56d6f5 100644 --- a/main/strings.c +++ b/main/strings.c @@ -77,13 +77,14 @@ int __ast_str_helper(struct ast_str **buf, ssize_t max_len, * reallocate the buffer and return a message telling to retry. */ if (need > (*buf)->__AST_STR_LEN && (max_len == 0 || (*buf)->__AST_STR_LEN < max_len) ) { + int len = (int)(*buf)->__AST_STR_LEN; if (max_len && max_len < need) { /* truncate as needed */ need = max_len; } else if (max_len == 0) { /* if unbounded, give more room for next time */ need += 16 + need / 4; } if (0) { /* debugging */ - ast_verbose("extend from %d to %d\n", (int)(*buf)->__AST_STR_LEN, need); + ast_verbose("extend from %d to %d\n", len, need); } if ( #if (defined(MALLOC_DEBUG) && !defined(STANDALONE)) @@ -92,7 +93,7 @@ int __ast_str_helper(struct ast_str **buf, ssize_t max_len, ast_str_make_space(buf, need) #endif ) { - ast_verbose("failed to extend from %d to %d\n", (int)(*buf)->__AST_STR_LEN, need); + ast_verbose("failed to extend from %d to %d\n", len, need); va_end(aq); return AST_DYNSTR_BUILD_FAILED; } |