aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sbin/ping/ping.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index 011c77df816d..0b0e7a9fdd34 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -478,7 +478,7 @@ main(int argc, char *const *argv)
break;
case 's': /* size of packet to send */
ltmp = strtol(optarg, &ep, 0);
- if (*ep || ep == optarg || ltmp < 0)
+ if (*ep || ep == optarg || ltmp > INT_MAX || ltmp < 0)
errx(EX_USAGE, "invalid packet size: `%s'",
optarg);
if (uid != 0 && ltmp > DEFDATALEN) {