offchannel fixes; more memory verification
[srvx.git] / src / log.c
index f7457006c80dc00115a25d1c4eaac09e71ee60e1..aefadbb86496e05931bcc60b8400415ceaa7fbdd 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -719,9 +719,12 @@ log_entry_search(struct logSearch *discrim, entry_search_func esf, void *data)
     unsigned int matched = 0;
 
     if (discrim->type) {
-        struct logEntry *entry;
+        struct logEntry *entry, *last;
 
-        for (entry = discrim->type->log_oldest; entry; entry = entry->next) {
+        for (entry = discrim->type->log_oldest, last = NULL;
+             entry;
+             last = entry, entry = entry->next) {
+            verify(entry);
             if (entry_match(discrim, entry)) {
                 esf(entry, data);
                 if (++matched >= discrim->limit)