Fix Coverity CID 1466708 - correct pointer calculation in one case
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Wed, 16 Sep 2020 11:29:05 +0000 (13:29 +0200)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Thu, 17 Sep 2020 13:29:46 +0000 (15:29 +0200)
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12894)

crypto/http/http_lib.c

index 19b964e6133ecbf27aba6b93bf153216069ca70a..be790bda9023958a5b062c3d29ab0a157d430f95 100644 (file)
@@ -89,7 +89,7 @@ int OSSL_HTTP_parse_url(const char *url, char **phost, char **pport,
         if (pport_num == NULL) {
             p = strchr(port, '/');
             if (p == NULL)
-                p = p + strlen(port);
+                p = host_end + 1 + strlen(port);
         } else { /* make sure a numerical port value is given */
             portnum = strtol(port, &p, 10);
             if (p == port || (*p != '\0' && *p != '/'))