Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Aug 2020 11:42:36 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r364156 - stable/12/sbin/ipfw
Message-ID:  <202008121142.07CBga3e016996@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed Aug 12 11:42:36 2020
New Revision: 364156
URL: https://svnweb.freebsd.org/changeset/base/364156

Log:
  MFC r363904:
    Fix SIGSEGV in ipfw(8) when NAT64 prefix length is omitted.

Modified:
  stable/12/sbin/ipfw/nat64clat.c
  stable/12/sbin/ipfw/nat64stl.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/ipfw/nat64clat.c
==============================================================================
--- stable/12/sbin/ipfw/nat64clat.c	Wed Aug 12 11:37:28 2020	(r364155)
+++ stable/12/sbin/ipfw/nat64clat.c	Wed Aug 12 11:42:36 2020	(r364156)
@@ -303,6 +303,9 @@ nat64clat_config(const char *name, uint8_t set, int ac
 
 			if ((p = strchr(*av, '/')) != NULL)
 				*p++ = '\0';
+			else
+				errx(EX_USAGE,
+				    "Prefix length required: %s", *av);
 			if (inet_pton(AF_INET6, *av, &prefix) != 1)
 				errx(EX_USAGE,
 				    "Bad prefix: %s", *av);

Modified: stable/12/sbin/ipfw/nat64stl.c
==============================================================================
--- stable/12/sbin/ipfw/nat64stl.c	Wed Aug 12 11:37:28 2020	(r364155)
+++ stable/12/sbin/ipfw/nat64stl.c	Wed Aug 12 11:42:36 2020	(r364156)
@@ -249,6 +249,9 @@ nat64stl_create(const char *name, uint8_t set, int ac,
 			NEED1("IPv6 prefix6 required");
 			if ((p = strchr(*av, '/')) != NULL)
 				*p++ = '\0';
+			else
+				errx(EX_USAGE,
+				    "Prefix length required: %s", *av);
 			if (inet_pton(AF_INET6, *av, &cfg->prefix6) != 1)
 				errx(EX_USAGE,
 				    "Bad prefix: %s", *av);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008121142.07CBga3e016996>