mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
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:
parent
7d10a011c3
commit
1b06cbdc1f
@ -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