Running past the end of the chain would cause a SEGV. Signed-off-by: Egbert Eich <eich@freedesktop.org>