[farsight2/master] replace sprintf/strcmp with snprintf/strncmp

Olivier Crête olivier.crete at collabora.co.uk
Tue Jul 14 09:50:42 PDT 2009


---
 gst/fsmsnconference/fs-msn-connection.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gst/fsmsnconference/fs-msn-connection.c b/gst/fsmsnconference/fs-msn-connection.c
index e29b6d1..bf91e9f 100644
--- a/gst/fsmsnconference/fs-msn-connection.c
+++ b/gst/fsmsnconference/fs-msn-connection.c
@@ -640,9 +640,9 @@ connection_cb (FsMsnConnection *self, FsMsnPollFD *pollfd)
           if (recv(pollfd->pollfd.fd, str, 34, 0) != -1)
           {
             GST_DEBUG ("Got %s, checking if it's auth", str);
-            sprintf(check, "recipientid=%s&sessionid=%d\r\n\r\n",
+            snprintf(check, 35, "recipientid=%s&sessionid=%d\r\n\r\n",
                 self->local_recipient_id, self->session_id);
-            if (strcmp (str, check) == 0)
+            if (strncmp (str, check, 35) == 0)
             {
               GST_DEBUG ("Authentication successful");
               pollfd->status = FS_MSN_STATUS_CONNECTED;
-- 
1.5.6.5




More information about the farsight-commits mailing list