diff options
author | mnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-12-10 16:52:11 +0000 |
---|---|---|
committer | mnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-12-10 16:52:11 +0000 |
commit | 09bd01810a9b6d1ab5c7bb165e62c2860d2ce1aa (patch) | |
tree | 949586b0975e930a4a11dd3b43ce9c08a754f5fb /res | |
parent | 1db7dff1f0f1317288cbb018e2f030a38118c9c8 (diff) |
Prevent a memcpy overlap in GENERIC_FAX_EXEC_SET_VARS
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@298054 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_fax.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/res/res_fax.c b/res/res_fax.c index 460dc1f52..c22bad693 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -975,9 +975,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) |