Blame SOURCES/wget-1.14-digest-auth-qop-segfault-fix.patch

bc22e6
diff --git a/src/http.c b/src/http.c
bc22e6
index 5ee1c93..b45c404 100644
bc22e6
--- a/src/http.c
bc22e6
+++ b/src/http.c
bc22e6
@@ -3728,7 +3728,7 @@ digest_authentication_encode (const char *au, const char *user,
bc22e6
     md5_finish_ctx (&ctx, hash);
bc22e6
     dump_hash (a2buf, hash);
bc22e6
 
bc22e6
-    if (!strcmp(qop,"auth"))
bc22e6
+    if (qop && !strcmp(qop,"auth"))
bc22e6
       {
bc22e6
         /* RFC 2617 Digest Access Authentication */
bc22e6
         /* generate random hex string */
bc22e6
@@ -3776,7 +3776,7 @@ digest_authentication_encode (const char *au, const char *user,
bc22e6
 
bc22e6
     res = xmalloc (res_size);
bc22e6
 
bc22e6
-    if (!strcmp(qop,"auth"))
bc22e6
+    if (qop && !strcmp (qop, "auth"))
bc22e6
       {
bc22e6
         snprintf (res, res_size, "Digest "\
bc22e6
                 "username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\""\