svn commit: r356780 - stable/10/usr.sbin/arp

Eugene Grosbein eugen at FreeBSD.org
Thu Jan 16 08:27:31 UTC 2020


Author: eugen
Date: Thu Jan 16 08:27:30 2020
New Revision: 356780
URL: https://svnweb.freebsd.org/changeset/base/356780

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/10/usr.sbin/arp/arp.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/arp/arp.c
==============================================================================
--- stable/10/usr.sbin/arp/arp.c	Thu Jan 16 08:16:12 2020	(r356779)
+++ stable/10/usr.sbin/arp/arp.c	Thu Jan 16 08:27:30 2020	(r356780)
@@ -607,8 +607,7 @@ print_entry(struct sockaddr_dl *sdl,
 	} else
 		printf("(incomplete)");
 
-	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) {
 			printf(" on %s", p->if_name);
 			break;


More information about the svn-src-all mailing list