# HG changeset patch # User Daniel Atallah # Date 1135005439 0 # Node ID b7f7f3a685eae812bfd2f55d9ea2e072df619753 # Parent e3b4abe7e0f84bcd5ced19326ecdbbf33100c9a6 [gaim-migrate @ 14882] Fix an "off by one" parsing error when parsing the nonce token. I haven't actually tested this, but this should hopefully fix bug #1385135. committer: Tailor Script diff -r e3b4abe7e0f8 -r b7f7f3a685ea src/protocols/simple/simple.c --- a/src/protocols/simple/simple.c Mon Dec 19 14:24:40 2005 +0000 +++ b/src/protocols/simple/simple.c Mon Dec 19 15:17:19 2005 +0000 @@ -342,10 +342,10 @@ auth->type = 1; parts = g_strsplit(hdr, " ", 0); while(parts[i]) { - if(!strncmp(parts[i],"nonce",5)) { - auth->nonce = g_strndup(parts[i]+7,strlen(parts[i]+7)-1); + if(!strncmp(parts[i], "nonce", 5)) { + auth->nonce = g_strndup(parts[i]+7,strlen(parts[i]+7)-2); } - if(!strncmp(parts[i],"realm",5)) { + else if(!strncmp(parts[i], "realm", 5)) { auth->realm = g_strndup(parts[i]+7,strlen(parts[i]+7)-2); } i++; @@ -516,14 +516,14 @@ if(addheaders) addh=addheaders; if(sip->registrar.type && !strcmp(method,"REGISTER")) { buf = auth_header(sip, &sip->registrar, method, url); - auth = g_strdup_printf("Authorization: %s",buf); + auth = g_strdup_printf("Authorization: %s", buf); g_free(buf); gaim_debug(GAIM_DEBUG_MISC, "simple", "header %s", auth); } if(sip->proxy.type && strcmp(method,"REGISTER")) { buf = auth_header(sip, &sip->proxy, method, url); - auth = g_strdup_printf("Proxy-Authorization: %s",buf); + auth = g_strdup_printf("Proxy-Authorization: %s", buf); g_free(buf); gaim_debug(GAIM_DEBUG_MISC, "simple", "header %s", auth); }