diff options
author | Yang Tse <yangsita@gmail.com> | 2009-09-17 11:45:27 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2009-09-17 11:45:27 +0000 |
commit | 31e106ced2b37e1cb1b54f9f5f5d56df82577ede (patch) | |
tree | bb857fa33f2db10999cf85cee70c397af6e76440 /lib | |
parent | 250ba9949894571052888cd2065defbb3e00b183 (diff) |
Attempt to silence bogus compiler warning: "Potential null pointer dereference"
Diffstat (limited to 'lib')
-rw-r--r-- | lib/url.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -3946,9 +3946,11 @@ static CURLcode parse_remote_port(struct SessionHandle *data, conn->host.name++; /* skip over the starting bracket */ portptr = strchr(conn->host.name, ']'); - *portptr++ = 0; /* zero terminate, killing the bracket */ - if(':' != *portptr) - portptr = NULL; /* no port number available */ + if(portptr) { + *portptr++ = '\0'; /* zero terminate, killing the bracket */ + if(':' != *portptr) + portptr = NULL; /* no port number available */ + } } else portptr = strrchr(conn->host.name, ':'); |