Commit 5ddcf6a2 authored by Nils Goroll's avatar Nils Goroll Committed by Lasse Karstensen

check for overrun before looking at the next vsm record

Fixes #1873
parent ab835605
...@@ -126,6 +126,10 @@ vslc_vsm_next(const struct VSL_cursor *cursor) ...@@ -126,6 +126,10 @@ vslc_vsm_next(const struct VSL_cursor *cursor)
CHECK_OBJ_NOTNULL(c->vsm, VSM_MAGIC); CHECK_OBJ_NOTNULL(c->vsm, VSM_MAGIC);
while (1) { while (1) {
i = vslc_vsm_check(&c->cursor, &c->next);
if (i <= 0)
return (-3); /* Overrun */
t = *(volatile const uint32_t *)c->next.ptr; t = *(volatile const uint32_t *)c->next.ptr;
AN(t); AN(t);
...@@ -147,10 +151,6 @@ vslc_vsm_next(const struct VSL_cursor *cursor) ...@@ -147,10 +151,6 @@ vslc_vsm_next(const struct VSL_cursor *cursor)
return (0); /* No new records available */ return (0); /* No new records available */
} }
i = vslc_vsm_check(&c->cursor, &c->next);
if (i <= 0)
return (-3); /* Overrun */
c->cursor.rec = c->next; c->cursor.rec = c->next;
c->next.ptr = VSL_NEXT(c->next.ptr); c->next.ptr = VSL_NEXT(c->next.ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment