Date: Tue, 10 Mar 2015 20:52:04 +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: r279862 - head/cddl/contrib/opensolaris/common/ctf Message-ID: <201503102052.t2AKq4Gk038832@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Tue Mar 10 20:52:03 2015 New Revision: 279862 URL: https://svnweb.freebsd.org/changeset/base/279862 Log: ctf_discard(): fetch the next list element before restarting the loop. If we end up skipping a dynamic type because it has already been committed to the container, we would previously either set the loop variable to an uninitialized local variable, or set it to itself, resulting in an infinite loop. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c ============================================================================== --- head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Tue Mar 10 20:43:16 2015 (r279861) +++ head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Tue Mar 10 20:52:03 2015 (r279862) @@ -583,10 +583,10 @@ ctf_discard(ctf_file_t *fp) return (0); /* no update required */ for (dtd = ctf_list_prev(&fp->ctf_dtdefs); dtd != NULL; dtd = ntd) { + ntd = ctf_list_prev(dtd); if (dtd->dtd_type <= fp->ctf_dtoldid) continue; /* skip types that have been committed */ - ntd = ctf_list_prev(dtd); ctf_dtd_delete(fp, dtd); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503102052.t2AKq4Gk038832>