setarch: avoid NULL dereference [coverity check]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2019-05-28 13:08:21 +02:00
parent d3149a8556
commit cf5debba06
1 changed files with 1 additions and 1 deletions

View File

@ -246,7 +246,7 @@ static struct arch_domain *get_arch_domain(struct arch_domain *doms, const char
{
struct arch_domain *d;
for (d = doms; d->perval >= 0; d++) {
for (d = doms; d && d->perval >= 0; d++) {
if (!strcmp(pers, d->target_arch))
break;
}