Skip to content
Permalink
Browse files

check port is valid

  • Loading branch information
vieux committed Nov 1, 2013
1 parent e3c4984 commit 7765a2829744b3dd7079ac77d2b5aef7150b6dbb
Showing with 6 additions and 0 deletions.
  1. +6 −0 utils.go
@@ -225,6 +225,12 @@ func parsePortSpecs(ports []string) (map[Port]struct{}, map[Port][]PortBinding,
if containerPort == "" {
return nil, nil, fmt.Errorf("No port specified: %s<empty>", rawPort)
}
if _, err := strconv.ParseUint(containerPort, 10, 16); err != nil {
return nil, nil, fmt.Errorf("Invalid containerPort: %s", containerPort)
}
if _, err := strconv.ParseUint(hostPort, 10, 16); err != nil {
return nil, nil, fmt.Errorf("Invalid hostPort: %s", hostPort)
}

port := NewPort(proto, containerPort)
if _, exists := exposedPorts[port]; !exists {

0 comments on commit 7765a28

Please sign in to comment.
You can’t perform that action at this time.