summaryrefslogtreecommitdiff
path: root/pbx
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-05-10 20:56:09 +0000
committerKinsey Moore <kmoore@digium.com>2012-05-10 20:56:09 +0000
commitdd81b047dbf15a501b81354db505daf50703a1a0 (patch)
tree01754d4206c865653717baf23e47ed264f7a6b3d /pbx
parent8227f70cd70f497cb03c1f9aab63950bcd979d8b (diff)
Resolve FORWARD_NULL static analysis warnings
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20, 22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111, and 115. Finding numbers 26, 33, and 29 were already resolved. Those skipped were either extended/deprecated or in areas of code that shouldn't be disturbed. (Closes issue ASTERISK-19650) ........ Merged revisions 366167 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366168 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx')
-rw-r--r--pbx/dundi-parser.c12
-rw-r--r--pbx/pbx_dundi.c2
2 files changed, 9 insertions, 5 deletions
diff --git a/pbx/dundi-parser.c b/pbx/dundi-parser.c
index 3c57442a4..418a28c58 100644
--- a/pbx/dundi-parser.c
+++ b/pbx/dundi-parser.c
@@ -512,8 +512,10 @@ int dundi_ie_append_cause(struct dundi_ie_data *ied, unsigned char ie, unsigned
ied->buf[ied->pos++] = ie;
ied->buf[ied->pos++] = datalen;
ied->buf[ied->pos++] = cause;
- memcpy(ied->buf + ied->pos, data, datalen-1);
- ied->pos += datalen-1;
+ if (data) {
+ memcpy(ied->buf + ied->pos, data, datalen-1);
+ ied->pos += datalen-1;
+ }
return 0;
}
@@ -531,8 +533,10 @@ int dundi_ie_append_hint(struct dundi_ie_data *ied, unsigned char ie, unsigned s
flags = htons(flags);
memcpy(ied->buf + ied->pos, &flags, sizeof(flags));
ied->pos += 2;
- memcpy(ied->buf + ied->pos, data, datalen-1);
- ied->pos += datalen-2;
+ if (data) {
+ memcpy(ied->buf + ied->pos, data, datalen-2);
+ ied->pos += datalen-2;
+ }
return 0;
}
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index 2e5c39e17..52430838a 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -1021,7 +1021,7 @@ static int dundi_prop_precache(struct dundi_transaction *trans, struct dundi_ies
totallen += (ies->eidcount - skipfirst) * sizeof(dundi_eid);
st = ast_calloc(1, totallen);
if (st) {
- ast_copy_string(st->called_context, ies->called_context, sizeof(st->called_context));
+ ast_copy_string(st->called_context, dr.dcontext, sizeof(st->called_context));
ast_copy_string(st->called_number, ies->called_number, sizeof(st->called_number));
st->trans = trans;
st->ttl = ies->ttl - 1;