ring_f() tests for an invalid index which would overrun the
iocur_ring[] array and warns, but then uses it anyway.
Return immediately if it's out of bounds.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
}
index = (int)strtoul(argv[1], NULL, 0);
- if (index < 0 || index >= RING_ENTRIES)
+ if (index < 0 || index >= RING_ENTRIES) {
dbprintf(_("invalid entry: %d\n"), index);
+ return 0;
+ }
ring_current = index;