From: Helen Clemson <helen.clem...@stericsson.com>

Strlen includes a NULL character.
---
 drivers/stemodem/voicecall.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/stemodem/voicecall.c b/drivers/stemodem/voicecall.c
index 6f948f7..423f63e 100644
--- a/drivers/stemodem/voicecall.c
+++ b/drivers/stemodem/voicecall.c
@@ -375,16 +375,14 @@ static void ste_send_dtmf(struct ofono_voicecall *vc, 
const char *dtmf,
 {
        struct voicecall_data *vd = ofono_voicecall_get_data(vc);
        struct cb_data *cbd = cb_data_new(cb, data);
-       int len = strlen(dtmf);
        int s;
        char *buf;
 
        if (cbd == NULL)
                goto error;
 
-       /* strlen("AT+VTS=) = 7 */
-       buf = g_try_new(char, len + 7);
-
+       /* strlen("AT+VTS=) = 7 + NULL */
+       buf = g_try_new(char, strlen(dtmf) + 8);
        if (buf == NULL)
                goto error;
 
-- 
1.7.1

_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to