From: Matthew Nicholson Date: Fri, 10 Dec 2010 16:53:43 +0000 (+0000) Subject: Merged revisions 298054 via svnmerge from X-Git-Tag: 11.0.0-beta1~2065 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f93c14bf559a038be25f99fecca71c46bf866af;p=thirdparty%2Fasterisk.git Merged revisions 298054 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r298054 | mnicholson | 2010-12-10 10:52:11 -0600 (Fri, 10 Dec 2010) | 2 lines Prevent a memcpy overlap in GENERIC_FAX_EXEC_SET_VARS ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@298055 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_fax.c b/res/res_fax.c index bfd4a51abe..716cbee01c 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -928,9 +928,12 @@ static void set_channel_variables(struct ast_channel *chan, struct ast_fax_sessi #define GENERIC_FAX_EXEC_SET_VARS(fax, chan, errorstr, reason) \ do { \ - ast_string_field_set(fax->details, result, S_OR(fax->details->result, "FAILED")); \ - ast_string_field_set(fax->details, resultstr, S_OR(fax->details->resultstr, reason)); \ - ast_string_field_set(fax->details, error, S_OR(fax->details->error, errorstr)); \ + if (ast_strlen_zero(fax->details->result)) \ + ast_string_field_set(fax->details, result, "FAILED"); \ + if (ast_strlen_zero(fax->details->resultstr)) \ + ast_string_field_set(fax->details, resultstr, reason); \ + if (ast_strlen_zero(fax->details->error)) \ + ast_string_field_set(fax->details, error, errorstr); \ set_channel_variables(chan, fax->details); \ } while (0)