]> granicus.if.org Git - neomutt/commitdiff
mutt_sasl: fix double negative in iptostring result check (fixes #3705)
authorBrendan Cully <brendan@kublai.com>
Sun, 7 Sep 2014 18:04:54 +0000 (11:04 -0700)
committerBrendan Cully <brendan@kublai.com>
Sun, 7 Sep 2014 18:04:54 +0000 (11:04 -0700)
mutt_sasl.c

index aa41a6f22e5f83702881bfa1f0fa50cee45c0c27..c568ecac893428b3e1d419199f30d420c6e9f449 100644 (file)
@@ -197,8 +197,8 @@ int mutt_sasl_client_new (CONNECTION* conn, sasl_conn_t** saslconn)
 
   size = sizeof (local);
   if (!getsockname (conn->fd, (struct sockaddr *)&local, &size)) {
-    if (!iptostring((struct sockaddr *)&local, size, iplocalport,
-                     IP_PORT_BUFLEN) != SASL_OK)
+    if (iptostring((struct sockaddr *)&local, size, iplocalport,
+                   IP_PORT_BUFLEN) == SASL_OK)
       plp = iplocalport;
     else
       dprint (2, (debugfile, "SASL failed to parse local IP address\n"));
@@ -208,8 +208,8 @@ int mutt_sasl_client_new (CONNECTION* conn, sasl_conn_t** saslconn)
   
   size = sizeof (remote);
   if (!getpeername (conn->fd, (struct sockaddr *)&remote, &size)){
-    if (!iptostring((struct sockaddr *)&remote, size, ipremoteport,
-                     IP_PORT_BUFLEN) != SASL_OK)
+    if (iptostring((struct sockaddr *)&remote, size, ipremoteport,
+                   IP_PORT_BUFLEN) == SASL_OK)
       prp = ipremoteport;
     else
       dprint (2, (debugfile, "SASL failed to parse remote IP address\n"));