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

This commit is contained in:
ajschult%verizon.net 2006-05-20 05:55:34 +00:00
parent 7d10a011c3
commit 1b06cbdc1f

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;