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

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