svn commit: r316178 - head/usr.sbin/rrenumd

Conrad Meyer cem at FreeBSD.org
Wed Mar 29 21:04:41 UTC 2017


Author: cem
Date: Wed Mar 29 21:04:39 2017
New Revision: 316178
URL: https://svnweb.freebsd.org/changeset/base/316178

Log:
  rrenumd(8): Fix a trivial Coverity warning
  
  Coverity warns that it is invalid to access following struct members by
  accessing the current struct member pointer plus one.  Assuming the
  compilers aren't abusing this kind of UB yet, this cleanup isn't a
  functional change.
  
  Reported by:	Coverity
  CID:		1368713
  Sponsored by:	Dell EMC Isilon

Modified:
  head/usr.sbin/rrenumd/parser.y

Modified: head/usr.sbin/rrenumd/parser.y
==============================================================================
--- head/usr.sbin/rrenumd/parser.y	Wed Mar 29 20:49:41 2017	(r316177)
+++ head/usr.sbin/rrenumd/parser.y	Wed Mar 29 21:04:39 2017	(r316178)
@@ -336,8 +336,8 @@ match_prefix_definition:
 			struct icmp6_router_renum *irr;
 			struct rr_pco_match *rpm;
 
-			irr = (struct icmp6_router_renum *)&ple_cur.pl_irr;
-			rpm = (struct rr_pco_match *)(irr + 1);
+			irr = &ple_cur.pl_irr;
+			rpm = &ple_cur.pl_rpm;
 			memset(rpm, 0, sizeof(*rpm));
 
 			rpm->rpm_code = $1;


More information about the svn-src-head mailing list