libmount: fix potential null pointer dereference

This is false positive warning, but lets silence it so that if and when
warnings crop up they are easy to notice and take seriously.

libmount/src/optstr.c:354:29: warning: potential null pointer dereference
[-Wnull-dereference]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2019-07-12 21:56:52 +01:00
parent 34813bdd29
commit 371be858d7
No known key found for this signature in database
GPG Key ID: 0D46FEF7E61DBB46
1 changed files with 3 additions and 1 deletions

View File

@ -351,7 +351,9 @@ int mnt_optstr_deduplicate_option(char **optstr, const char *name)
end = ol.end;
opt = end && *end ? end + 1 : NULL;
}
} while (rc == 0 && opt && *opt);
if (opt == NULL)
break;
} while (rc == 0 && *opt);
return rc < 0 ? rc : begin ? 0 : 1;
}