net: fix nla_strcmp to handle more then one trailing null character
[sfrench/cifs-2.6.git] / lib / nlattr.c
index 5b6116e81f9f206462d691e5af52aa3044fd900e..1d051ef66afe5dc992453360afae21874cf3f4f6 100644 (file)
@@ -828,7 +828,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;