parser: safety check for max port length in URI

- can't be longer than 5, a port being 16b value
- reported by Kevin Wojtysiak
(cherry picked from commit 13fd48f89555f5421e8285669e303bcefe44f149)
rr: use port.len to check for buffer overflow instead of max port len

    - reported by Kevin Wojtysiak
    (from commit 28a8b87885e373bee8cc81985277ae718973fdfd)