diff --git a/lib/nlattr.c b/lib/nlattr.c index 3d8295c85505..5cf179aeefe6 100644 --- a/lib/nlattr.c +++ b/lib/nlattr.c @@ -379,7 +379,7 @@ int nla_strcmp(const struct nlattr *nla, const char *str) int attrlen = nla_len(nla); int d; - if (attrlen > 0 && buf[attrlen - 1] == '\0') + while (attrlen > 0 && buf[attrlen - 1] == '\0') attrlen--; d = attrlen - len;