The loop should only iterate to array_size - 1. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
@@ -403,7 +403,7 @@ void ospf6_spf_reason_string (unsigned int reason, char *buf, int size)
if (!buf)
return;
- for (bit = 0; bit <= (sizeof(ospf6_spf_reason_str) / sizeof(char *)); bit++)
+ for (bit = 0; bit < array_size(ospf6_spf_reason_str); bit++)
{
if ((reason & (1 << bit)) && (len < size))