From b2b13f69ae5916477ea3f6e37b57b52a83ac5a63 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 4 Apr 2016 16:24:31 +0200 Subject: [PATCH] mncc: Use snprintf correctly create format specifier I was focusing so much on the length that I didn't notice the wrong usage of snprintf. Correct it. Warning on Ubuntu: mncc.c:679:3: warning: format not a string literal and no format arguments [-Wformat-security] snprintf(mncc.imsi, 15, called); --- src/mncc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mncc.c b/src/mncc.c index 47dd72b..4778424 100644 --- a/src/mncc.c +++ b/src/mncc.c @@ -676,7 +676,7 @@ int mncc_create_remote_leg(struct mncc_connection *conn, struct call *call, memcpy(&mncc.calling.number, calling, sizeof(mncc.calling.number)); if (conn->app->use_imsi_as_id) { - snprintf(mncc.imsi, 15, called); + snprintf(mncc.imsi, 15, "%s", called); } else { mncc.fields |= MNCC_F_CALLED; mncc.called.plan = 1;