aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar IceN9ne2018-09-04 15:07:34 -0400
committerGravatar IceN9ne2018-09-04 15:07:34 -0400
commit1c3bbfcc44a342d327a4bc0029b1df5be52af7f9 (patch)
tree2905915bd5e296aebd469e236037744fdfff0afe /src
parent KviHttp: support relative redirects; fix #2398 (#2399) (diff)
downloadKVIrc-1c3bbfcc44a342d327a4bc0029b1df5be52af7f9.tar.gz
KVIrc-1c3bbfcc44a342d327a4bc0029b1df5be52af7f9.tar.bz2
KVIrc-1c3bbfcc44a342d327a4bc0029b1df5be52af7f9.zip
KviHttpRequest: Fix potential null pointer dereference
Diffstat (limited to 'src')
-rw-r--r--src/kvilib/net/KviHttpRequest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kvilib/net/KviHttpRequest.cpp b/src/kvilib/net/KviHttpRequest.cpp
index af2ebf4f3..011437399 100644
--- a/src/kvilib/net/KviHttpRequest.cpp
+++ b/src/kvilib/net/KviHttpRequest.cpp
@@ -718,9 +718,8 @@ bool KviHttpRequest::processHeader(KviCString & szHeader)
}
KviCString * headerLocation = hdr.find("Location");
- QString location(headerLocation->ptr());
- if(location.isEmpty())
+ if(!headerLocation || headerLocation->isEmpty())
{
resetInternalStatus();
m_szLastError = __tr2qs("Bad redirect");
@@ -729,6 +728,7 @@ bool KviHttpRequest::processHeader(KviCString & szHeader)
}
KviUrl url;
+ QString location(headerLocation->ptr());
if(location.startsWith('/'))
{