Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jan 2020 08:16:12 +0000 (UTC)
From:      Eugene Grosbein <eugen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r356779 - stable/11/usr.sbin/arp
Message-ID:  <202001160816.00G8GCDR061008@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eugen
Date: Thu Jan 16 08:16:12 2020
New Revision: 356779
URL: https://svnweb.freebsd.org/changeset/base/356779

Log:
  MFC r356551: arp(8): avoid segfaulting due to out-of-bounds memory access
  
  Fix obvious mistake that sometimes results in reading memory
  past end of an array.
  
  PR:             242784

Modified:
  stable/11/usr.sbin/arp/arp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/arp/arp.c
==============================================================================
--- stable/11/usr.sbin/arp/arp.c	Thu Jan 16 08:11:45 2020	(r356778)
+++ stable/11/usr.sbin/arp/arp.c	Thu Jan 16 08:16:12 2020	(r356779)
@@ -639,8 +639,7 @@ print_entry(struct sockaddr_dl *sdl,
 	} else
 		xo_emit("{d:/(incomplete)}{en:incomplete/true}");
 
-	for (p = ifnameindex; p && ifnameindex->if_index &&
-	    ifnameindex->if_name; p++) {
+	for (p = ifnameindex; p && p->if_index && p->if_name; p++) {
 		if (p->if_index == sdl->sdl_index) {
 			xo_emit(" on {:interface/%s}", p->if_name);
 			break;



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