pidgin: 04457e0e: Don't crash if there's no Hashed-Nonce o...

qulogic at pidgin.im qulogic at pidgin.im
Fri May 21 18:01:25 EDT 2010


-----------------------------------------------------------------
Revision: 04457e0e740d89b57995fa3b72294a2d8bd6b125
Ancestor: 9a6a7aa6835c4e6a55006750e5f92f7bc050e063
Author: qulogic at pidgin.im
Date: 2010-05-21T04:22:33
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/04457e0e740d89b57995fa3b72294a2d8bd6b125

Modified files:
        libpurple/protocols/msn/slp.c

ChangeLog: 

Don't crash if there's no Hashed-Nonce or Nonce.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slp.c	09359dfed30d12a6c9be41dd7d60119c9f984ed3
+++ libpurple/protocols/msn/slp.c	864aaeb0f3c92aba319412e66594644f32cc966d
@@ -291,9 +291,10 @@ parse_dc_nonce(const char *content, MsnD
 		guint32 n1, n5;
 		guint16 n2, n3, n4, n6;
 		nonce = get_token(content, "Nonce: {", "}\r\n");
-		*ntype = DC_NONCE_PLAIN;
-		if (sscanf(nonce, "%08x-%04hx-%04hx-%04hx-%08x%04hx",
+		if (nonce
+		 && sscanf(nonce, "%08x-%04hx-%04hx-%04hx-%08x%04hx",
 		           &n1, &n2, &n3, &n4, &n5, &n6) == 6) {
+			*ntype = DC_NONCE_PLAIN;
 			g_free(nonce);
 			nonce = g_malloc(16);
 			*(guint32 *)(nonce +  0) = GUINT32_TO_LE(n1);


More information about the Commits mailing list