notifications: Fix iteration over notification topics

Turns out that checking boundaries is important...

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2019-01-03 17:38:35 +01:00 committed by Rusty Russell
parent 5fd17602d0
commit 71934f983a

View File

@ -8,7 +8,7 @@ const char *notification_topics[] = {
bool notifications_have_topic(const char *topic)
{
for (size_t i=0; ARRAY_SIZE(notification_topics); i++)
for (size_t i=0; i<ARRAY_SIZE(notification_topics); i++)
if (streq(topic, notification_topics[i]))
return true;
return false;