Bug 336038: Coverity 240, error checks in wrong order; check for NULL before using the variable. Patch by Jon Smirl <jonsmirl@yahoo.com>, r=bsmedberg

git-svn-id: svn://10.0.0.236/trunk@198070 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ajschult%verizon.net 2006-05-20 05:55:34 +00:00
parent b6b074e0d7
commit 8180143d7c

View File

@ -488,12 +488,12 @@ int
nsHTTPConn::ParseURL(const char *aProto, char *aURL, char **aHost,
int *aPort, char **aPath)
{
char *pos, *nextSlash, *nextColon, *end, *hostEnd;
int protoLen = strlen(aProto);
if (!aURL || !aHost || !aPort || !aPath || !aProto)
return E_PARAM;
char *pos, *nextSlash, *nextColon, *end, *hostEnd;
int protoLen = strlen(aProto);
if ((strncmp(aURL, aProto, protoLen) != 0) ||
(strlen(aURL) < 9))
return E_MALFORMED_URL;