summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Nicholson <mnicholson@digium.com>2010-12-10 16:53:43 +0000
committerMatthew Nicholson <mnicholson@digium.com>2010-12-10 16:53:43 +0000
commit9f93c14bf559a038be25f99fecca71c46bf866af (patch)
treeccb6c0cfebcc3320599519803b863fffb3ff5fde
parent1b0df8c30f929fe8f51236dcced49ffb40320e8d (diff)
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
-rw-r--r--res/res_fax.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/res/res_fax.c b/res/res_fax.c
index bfd4a51ab..716cbee01 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)