Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Nov 2014 07:01:38 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r275012 - head/cddl/contrib/opensolaris/lib/libdtrace/common
Message-ID:  <201411250701.sAP71cbR078398@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Nov 25 07:01:38 2014
New Revision: 275012
URL: https://svnweb.freebsd.org/changeset/base/275012

Log:
  Adjust some checks missed in r274637, now that pi_rname can be NULL.
  
  Additionally fix a misparenthesization in the same check, noticed while
  fixing the first bug. This bug only appears to cause problems if the same
  USDT probe appears twice within a static function.
  
  X-MFC-With:	r274637

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c	Tue Nov 25 06:43:17 2014	(r275011)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c	Tue Nov 25 07:01:38 2014	(r275012)
@@ -545,8 +545,9 @@ dt_probe_define(dt_provider_t *pvp, dt_p
 
 	for (pip = prp->pr_inst; pip != NULL; pip = pip->pi_next) {
 		if (strcmp(pip->pi_fname, fname) == 0 &&
-		    ((rname == NULL && pip->pi_rname[0] == '\0') ||
-		    (rname != NULL && strcmp(pip->pi_rname, rname)) == 0))
+		    ((rname == NULL && pip->pi_rname == NULL) ||
+		    (rname != NULL && pip->pi_rname != NULL &&
+		    strcmp(pip->pi_rname, rname) == 0)))
 			break;
 	}
 



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