At the second conditional iter->file could still be NULL. We need to
check for it again. Should never happen in practice, but better to be
sure.
Coverity ID: 6: Forward Null
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+2007-05-31 Theodore Tso <tytso@mit.edu>
+
+ * profile.c (profile_node_iterator): Avoid potential null
+ dereference bug.
+
2007-05-22 Theodore Tso <tytso@mit.edu>
* message.c (expand_inode_expression, expand_percent_expression):
* If the file has changed, then the node pointer is invalid,
* so we'll have search the file again looking for it.
*/
- if (iter->node && (iter->file->upd_serial != iter->file_serial)) {
+ if (iter->node && (iter->file &&
+ iter->file->upd_serial != iter->file_serial)) {
iter->flags &= ~PROFILE_ITER_FINAL_SEEN;
skip_num = iter->num;
iter->node = 0;
iter->num++;
if (!p) {
iter->file = iter->file->next;
- if (iter->file) {
- }
iter->node = 0;
skip_num = 0;
goto get_new_file;