# HG changeset patch # User Elliott Sales de Andrade # Date 1274415753 0 # Node ID ad6c8747e83522af095b147f774657e5a90d6dc3 # Parent 4bcb8e537fc04cf8aa44e2d16b90eaa33137fb4a Don't crash if there's no Hashed-Nonce or Nonce. diff -r 4bcb8e537fc0 -r ad6c8747e835 libpurple/protocols/msn/slp.c --- a/libpurple/protocols/msn/slp.c Fri May 21 04:07:02 2010 +0000 +++ b/libpurple/protocols/msn/slp.c Fri May 21 04:22:33 2010 +0000 @@ -291,9 +291,10 @@ 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);