[asterisk-commits] mnicholson: branch 1.8 r298054 - /branches/1.8/res/res_fax.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Dec 10 10:52:14 CST 2010
Author: mnicholson
Date: Fri Dec 10 10:52:11 2010
New Revision: 298054
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=298054
Log:
Prevent a memcpy overlap in GENERIC_FAX_EXEC_SET_VARS
Modified:
branches/1.8/res/res_fax.c
Modified: branches/1.8/res/res_fax.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_fax.c?view=diff&rev=298054&r1=298053&r2=298054
==============================================================================
--- branches/1.8/res/res_fax.c (original)
+++ branches/1.8/res/res_fax.c Fri Dec 10 10:52:11 2010
@@ -975,9 +975,12 @@
#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)
More information about the asterisk-commits
mailing list