UINT32 minLen;
UINT32 maxLen;
UINT32 len;
- BOOLEAN ret = FALSE;
+ BOOLEAN ret = TRUE;
if ((policy->type == NL_A_NO_ATTR) ||
(policy->type == NL_A_VAR_LEN)) {
/* Do not validate anything for attributes of type var length */
- ret = TRUE;
+ ret = FALSE;
goto done;
}
if (len < minLen || len > maxLen) {
OVS_LOG_WARN("Attribute: %p, len: %d, not in valid range, "
"min: %d, max: %d", nla, len, minLen, maxLen);
+ ret = FALSE;
goto done;
}
if (policy->type == NL_A_STRING) {
if (((PCHAR) nla)[nla->nlaLen - 1]) {
OVS_LOG_WARN("Attributes %p lacks null at the end", nla);
+ ret = FALSE;
goto done;
}
if (memchr(nla + 1, '\0', len - 1) != NULL) {
OVS_LOG_WARN("Attributes %p has bad length", nla);
+ ret = FALSE;
goto done;
}
}