From 18247044664e111b4d0bc6fb911c1ddde83c17ce Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Tue, 13 Nov 2012 17:57:27 +0200 Subject: [PATCH] jabber: use safe snprintf instead of sprintf --- src/jabber.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jabber.c b/src/jabber.c index 1af0bcdb..06919a90 100644 --- a/src/jabber.c +++ b/src/jabber.c @@ -316,9 +316,9 @@ jabber_update_presence(jabber_presence_t status, const char * const msg) xmpp_stanza_t *presence = stanza_create_presence(jabber_conn.ctx, show, msg); if (pri != 0) { xmpp_stanza_t *priority, *value; - char pri_str[5]; + char pri_str[10]; - sprintf(pri_str, "%d", pri); + snprintf(pri_str, sizeof(pri_str), "%d", pri); priority = xmpp_stanza_new(jabber_conn.ctx); value = xmpp_stanza_new(jabber_conn.ctx); xmpp_stanza_set_name(priority, STANZA_NAME_PRIORITY);