From fe757a5b8348fd13ed96d1f69c846c5c8d9351a1 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 25 Jul 2011 22:57:08 -0500 Subject: voicecall: Be more paranoid and null terminate --- src/voicecall.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/voicecall.c b/src/voicecall.c index 7b01c9c9..23976afa 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -2236,10 +2236,13 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc, } if (v->call->clip_validity == CLIP_VALIDITY_NOT_AVAILABLE) { + char *number = v->call->phone_number.number; + v->call->phone_number.type = req->ph.type; - strncpy(v->call->phone_number.number, req->ph.number, + strncpy(number, req->ph.number, OFONO_MAX_PHONE_NUMBER_LENGTH); v->call->clip_validity = CLIP_VALIDITY_VALID; + number[OFONO_MAX_PHONE_NUMBER_LENGTH] = '\0'; } v->message = req->message; -- cgit v1.2.3