aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-10 16:53:43 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-10 16:53:43 +0000
commitc09096609f888b0cafddb7435d2b167030f40611 (patch)
treeccb6c0cfebcc3320599519803b863fffb3ff5fde
parentf8c6b2c905e99ceaf72184d2cbcd729274a894cb (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: http://svn.digium.com/svn/asterisk/trunk@298055 f38db490-d61c-443f-a65b-d21fe96a405b
-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)