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:
parent
b6b074e0d7
commit
8180143d7c
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user