Skip to content

Commit e2135de

Browse files
committed
Fix CID 1385633 (Dereference before null check)
Signed-off-by: Stefan Weil <[email protected]>
1 parent af72ad7 commit e2135de

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ccutil/elst.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,13 @@ ELIST_LINK *ELIST_ITERATOR::forward() {
210210
cycle_pt = next;
211211
current = next;
212212
}
213+
#ifndef NDEBUG
214+
if (!current)
215+
NULL_DATA.error ("ELIST_ITERATOR::forward", ABORT, nullptr);
216+
#endif
213217
next = current->next;
214218

215219
#ifndef NDEBUG
216-
if (!current)
217-
NULL_DATA.error ("ELIST_ITERATOR::forward", ABORT, nullptr);
218220
if (!next)
219221
NULL_NEXT.error ("ELIST_ITERATOR::forward", ABORT,
220222
"This is: %p Current is: %p", this, current);

0 commit comments

Comments
 (0)