From 37088e19f0f390caa2a727b0c4c33d719698fe57 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 5 Feb 2010 12:01:45 -0600 Subject: Fix: Use snprintf instead of sprintf in mbmmodem --- drivers/mbmmodem/gprs-context.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/mbmmodem') diff --git a/drivers/mbmmodem/gprs-context.c b/drivers/mbmmodem/gprs-context.c index bbe7a9ad..3e7a75bf 100644 --- a/drivers/mbmmodem/gprs-context.c +++ b/drivers/mbmmodem/gprs-context.c @@ -320,7 +320,7 @@ static void mbm_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data) ncbd = g_memdup(cbd, sizeof(struct cb_data)); - sprintf(buf, "AT*ENAP=1,%u", gcd->active_context); + snprintf(buf, sizeof(buf), "AT*ENAP=1,%u", gcd->active_context); if (g_at_chat_send(gcd->chat, buf, none_prefix, mbm_enap_up_cb, ncbd, g_free) > 0) @@ -350,14 +350,14 @@ static void mbm_gprs_activate_primary(struct ofono_gprs_context *gc, cbd->user = gc; - sprintf(buf, "AT*EIAAUW=%d,1,\"%s\",\"%s\"", ctx->cid, - ctx->username, ctx->password); + snprintf(buf, sizeof(buf), "AT*EIAAUW=%d,1,\"%s\",\"%s\"", + ctx->cid, ctx->username, ctx->password); if (g_at_chat_send(gcd->chat, buf, none_prefix, NULL, NULL, NULL) == 0) goto error; - len = sprintf(buf, "AT+CGDCONT=%u,\"IP\"", ctx->cid); + len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\"", ctx->cid); if (ctx->apn) snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"", -- cgit v1.2.3