]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared/bootspec: avoid going through -1 when calculating array index 11933/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 8 Mar 2019 13:37:26 +0000 (14:37 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 12 Mar 2019 12:32:45 +0000 (13:32 +0100)
commit388d2993ec48ad1c8249b42f4494dfd473723518
treed61ca82c7b4582c0ff02cb6b993125c83e1bf38e
parent7a2cb0228c2f1b7d95f6be7a751d1074d03e9cb5
shared/bootspec: avoid going through -1 when calculating array index

Coverity was complaining in CID#1399407 that config->entries might be used
while NULL. Let's add an assert to make sure it's not.

Also, let's quit early if we have no entries to loop through. The code was
not incorrect, but it's cleaner to avoid any negative indices.
src/shared/bootspec.c