From: Matthew Jordan Date: Mon, 21 Jan 2013 04:05:29 +0000 (+0000) Subject: Fix crash in app_minivm when mime encoding string X-Git-Tag: 1.8.21.0-rc1~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fcb9c5ff503c739e747dd093773986d73ed71be6;p=thirdparty%2Fasterisk.git Fix crash in app_minivm when mime encoding string An incorrect string initializations was left in ast_str_encode_mime from the patch that converted string manipulations to use ast_str strings (r191140). The string initialization causes a crash when ast_str_set is called on the string later on in the function. (closes issue ASTERISK-18697) Reported by: Chris Boot patches: minivm-null-pointer-dereference-fix.patch uploaded by bootc (license 6309) (issue ASTERISK-20854) Reported by: Chris Warr Tested by: Chris Warr git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@379608 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_minivm.c b/apps/app_minivm.c index d0cc8b75ff..63b28496e9 100644 --- a/apps/app_minivm.c +++ b/apps/app_minivm.c @@ -1159,7 +1159,6 @@ static const char *ast_str_encode_mime(struct ast_str **end, ssize_t maxlen, con { struct ast_str *tmp = ast_str_alloca(80); int first_section = 1; - *end = '\0'; ast_str_reset(*end); ast_str_set(&tmp, -1, "=?%s?Q?", charset);