# HG changeset patch # User Elliott Sales de Andrade # Date 1275088617 0 # Node ID fc93bc1a546fc8b74c5f043e1b5538654e9e9c31 # Parent ef7303c25751b0d929f537db05e8649c0ab091c9 So, elb informs me this is probably not safe on non-x86 architectures. Swapping the types of these two should hopefully avoid a non-aligned write. diff -r ef7303c25751 -r fc93bc1a546f libpurple/protocols/msn/slp.c --- a/libpurple/protocols/msn/slp.c Fri May 28 21:26:57 2010 +0000 +++ b/libpurple/protocols/msn/slp.c Fri May 28 23:16:57 2010 +0000 @@ -288,11 +288,11 @@ if (nonce) { *ntype = DC_NONCE_SHA1; } else { - guint32 n1, n5; - guint16 n2, n3, n4, n6; + guint32 n1, n6; + guint16 n2, n3, n4, n5; nonce = get_token(content, "Nonce: {", "}\r\n"); if (nonce - && sscanf(nonce, "%08x-%04hx-%04hx-%04hx-%08x%04hx", + && sscanf(nonce, "%08x-%04hx-%04hx-%04hx-%04hx%08x", &n1, &n2, &n3, &n4, &n5, &n6) == 6) { *ntype = DC_NONCE_PLAIN; g_free(nonce); @@ -301,8 +301,8 @@ *(guint16 *)(nonce + 4) = GUINT16_TO_LE(n2); *(guint16 *)(nonce + 6) = GUINT16_TO_LE(n3); *(guint16 *)(nonce + 8) = GUINT16_TO_BE(n4); - *(guint32 *)(nonce + 10) = GUINT32_TO_BE(n5); - *(guint16 *)(nonce + 14) = GUINT16_TO_BE(n6); + *(guint16 *)(nonce + 10) = GUINT16_TO_BE(n5); + *(guint32 *)(nonce + 12) = GUINT32_TO_BE(n6); } else { /* Invalid nonce, so ignore request */ g_free(nonce);