aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/common
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2015-03-10 20:52:03 +0000
committerMark Johnston <markj@FreeBSD.org>2015-03-10 20:52:03 +0000
commitba8d15d3a8b10be9f3a0cb86a60246f225a36736 (patch)
tree6b4950c0a53c352127e5563d9b6742c615969673 /cddl/contrib/opensolaris/common
parent26a222dc0c048fc071b548eadad7b80405a1b126 (diff)
downloadsrc-ba8d15d3a8b10be9f3a0cb86a60246f225a36736.tar.gz
src-ba8d15d3a8b10be9f3a0cb86a60246f225a36736.zip
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
Notes
Notes: svn path=/head/; revision=279862
Diffstat (limited to 'cddl/contrib/opensolaris/common')
-rw-r--r--cddl/contrib/opensolaris/common/ctf/ctf_create.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_create.c b/cddl/contrib/opensolaris/common/ctf/ctf_create.c
index 736481482751..41e81e50fd08 100644
--- a/cddl/contrib/opensolaris/common/ctf/ctf_create.c
+++ b/cddl/contrib/opensolaris/common/ctf/ctf_create.c
@@ -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);
}