From: florian Date: Thu, 1 Dec 2022 07:34:06 +0000 (+0000) Subject: Oops, the tweak was not correct, go with my original version. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1c9f076b709376deec194a0bf032d5d7f382f995;p=openbsd Oops, the tweak was not correct, go with my original version. Pointed out by tb. --- diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 38b97a81540..a3b3d650eb5 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping.c,v 1.247 2022/12/01 07:11:17 florian Exp $ */ +/* $OpenBSD: ping.c,v 1.248 2022/12/01 07:34:06 florian Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -1525,7 +1525,7 @@ pr_ipopt(int hlen, u_char *buf) break; default: printf("\nunknown option %x", *cp); - if (cp[IPOPT_OLEN] > 0 && cp[IPOPT_OLEN] < hlen) { + if (cp[IPOPT_OLEN] > 0 && (cp[IPOPT_OLEN] - 1) <= hlen) { hlen = hlen - (cp[IPOPT_OLEN] - 1); cp = cp + (cp[IPOPT_OLEN] - 1); } else