With the current code 'src' is never NULL. Nevertheless move the check for
NULL before dereferencing the pointer. Found with: Coverity Prevent(tm) CID: 2528
This commit is contained in:
parent
0061e03d7f
commit
91c7ac6740
@ -7296,11 +7296,13 @@ key_setkey(struct seckey *src, u_int16_t exttype)
|
||||
{
|
||||
struct mbuf *m;
|
||||
struct sadb_key *p;
|
||||
int len = PFKEY_ALIGN8(sizeof(struct sadb_key) + _KEYLEN(src));
|
||||
int len;
|
||||
|
||||
if (src == NULL)
|
||||
return NULL;
|
||||
|
||||
len = PFKEY_ALIGN8(sizeof(struct sadb_key) + _KEYLEN(src));
|
||||
|
||||
m = key_alloc_mbuf(len);
|
||||
if (m == NULL)
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user