diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-05-20 18:54:06 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-05-20 18:54:06 +0400 |
commit | 59ce289027e9d4c60d753daed22689c1bb01957c (patch) | |
tree | 5a1dba62f7d4b7b466847468103f69fa176f1004 /winsup/cygwin/flock.cc | |
parent | f027b7883c9adca3868ae667167b3b35220cb46d (diff) |
* flock.cc (delete_lock_in_parent): Use LIST_FOREACH_SAFE to avoid
dereferencing freed pointer (CID 60224).
Diffstat (limited to 'winsup/cygwin/flock.cc')
-rw-r--r-- | winsup/cygwin/flock.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/winsup/cygwin/flock.cc b/winsup/cygwin/flock.cc index 5ea3e067d..4250aba3f 100644 --- a/winsup/cygwin/flock.cc +++ b/winsup/cygwin/flock.cc @@ -1,6 +1,6 @@ /* flock.cc. NT specific implementation of advisory file locking. - Copyright 2003, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc. + Copyright 2003, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc. This file is part of Cygwin. @@ -724,13 +724,13 @@ err: DWORD WINAPI delete_lock_in_parent (PVOID param) { - inode_t *node; + inode_t *node, *next_node; lockf_t *lock, **prev; /* Scan list of all inodes, and reap stale BSD lock if lf_id matches. Remove inode if empty. */ INODE_LIST_LOCK (); - LIST_FOREACH (node, &cygheap->inode_list, i_next) + LIST_FOREACH_SAFE (node, &cygheap->inode_list, i_next, next_node) if (!node->inuse ()) { for (prev = &node->i_lockf, lock = *prev; lock; lock = *prev) |