X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Fhttp_digest.c;h=e2d865b0af09ed075ac1fc8f3a70cd622ff64deb;hb=e9bdad71c8277e20607fa1eaf0027d53a0dc1f37;hp=97230e79725135cb62bf84ac1e1c73f32cb0c936;hpb=3e62527ed71a7a362d7ec321e7f026edab35f8e2;p=platform%2Fupstream%2Fcurl.git diff --git a/lib/http_digest.c b/lib/http_digest.c index 97230e7..e2d865b 100644 --- a/lib/http_digest.c +++ b/lib/http_digest.c @@ -25,7 +25,7 @@ #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH) #include "urldata.h" -#include "rawstr.h" +#include "strcase.h" #include "vauth/vauth.h" #include "http_digest.h" /* The last 3 #include files should be in this order */ @@ -74,8 +74,8 @@ CURLcode Curl_output_digest(struct connectdata *conn, { CURLcode result; struct Curl_easy *data = conn->data; - unsigned char *path; - char *tmp; + unsigned char *path = NULL; + char *tmp = NULL; char *response; size_t len; bool have_chlg; @@ -95,8 +95,8 @@ CURLcode Curl_output_digest(struct connectdata *conn, if(proxy) { digest = &data->state.proxydigest; allocuserpwd = &conn->allocptr.proxyuserpwd; - userp = conn->proxyuser; - passwdp = conn->proxypasswd; + userp = conn->http_proxy.user; + passwdp = conn->http_proxy.passwd; authp = &data->state.authproxy; } else { @@ -140,12 +140,14 @@ CURLcode Curl_output_digest(struct connectdata *conn, http://www.fngtps.com/2006/09/http-authentication */ - if(authp->iestyle && ((tmp = strchr((char *)uripath, '?')) != NULL)) { - size_t urilen = tmp - (char *)uripath; - - path = (unsigned char *) aprintf("%.*s", urilen, uripath); + if(authp->iestyle) { + tmp = strchr((char *)uripath, '?'); + if(tmp) { + size_t urilen = tmp - (char *)uripath; + path = (unsigned char *) aprintf("%.*s", urilen, uripath); + } } - else + if(!tmp) path = (unsigned char *) strdup((char *) uripath); if(!path)