]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/http-support.c
Range check port numbers in URIs (<rdar://problem/23144461>)
[thirdparty/cups.git] / cups / http-support.c
index aae75e12d761ab44cb11c4ab88fd0c70b8f9c325..b98468adb51e62a767f2ed0ec56dbd937be5ba07 100644 (file)
@@ -1233,6 +1233,12 @@ httpSeparateURI(
 
       *port = (int)strtol(uri + 1, (char **)&uri, 10);
 
+      if (*port <= 0 || *port > 65535)
+      {
+        *port = 0;
+        return (HTTP_URI_STATUS_BAD_PORT);
+      }
+
       if (*uri != '/' && *uri)
       {
         *port = 0;