+
+ /* check key bits length */
+ if (ext->sadb_ext_type == SADB_EXT_KEY_AUTH ||
+ ext->sadb_ext_type == SADB_EXT_KEY_ENCRYPT) {
+ struct sadb_key *key = (struct sadb_key *)(uintptr_t)ext;
+ if (len < (sizeof(struct sadb_key) + _KEYLEN(key))) {
+ return EINVAL;
+ }
+ }