summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2017-10-11 06:03:41 -0600
committerGeorge Joseph <gjoseph@digium.com>2017-10-11 07:10:16 -0500
commit5bdad974586692586a1914960f48f281f46c8a24 (patch)
tree5fe9b9c85a38b3615351cc0eb52aabbd98a5ae3e
parentf3f3dcbf9eb4d1408397e902f0fd40131ec2a001 (diff)
chan_vpb: Fix a gcc 7 out-of-bounds complaint
chan_vpb was trying to use sizeof(*p->play_dtmf), where p->play_dtmf is defined as char[16], to get the length of the array but since p->play_dtmf is an actual array, sizeof(*p->play_dtmf) returns the size of the first array element, which is 1. gcc7 validly complains because the context in which it's used could cause an out-of-bounds condition. Change-Id: If9c4bfdb6b02fa72d39e0c09bf88900663c000ba
-rw-r--r--channels/chan_vpb.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/chan_vpb.cc b/channels/chan_vpb.cc
index 1f4b861c1..545cb53bd 100644
--- a/channels/chan_vpb.cc
+++ b/channels/chan_vpb.cc
@@ -1787,7 +1787,7 @@ static int vpb_digit_end(struct ast_channel *ast, char digit, unsigned int durat
ast_verb(4, "%s: vpb_digit: asked to play digit[%s]\n", p->dev, s);
ast_mutex_lock(&p->play_dtmf_lock);
- strncat(p->play_dtmf, s, sizeof(*p->play_dtmf) - strlen(p->play_dtmf) - 1);
+ strncat(p->play_dtmf, s, sizeof(p->play_dtmf) - strlen(p->play_dtmf) - 1);
ast_mutex_unlock(&p->play_dtmf_lock);
ast_mutex_unlock(&p->lock);