We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c188d4 commit 068b963Copy full SHA for 068b963
crypto/x509v3/v3_addr.c
@@ -84,10 +84,12 @@ static int length_from_afi(const unsigned afi)
84
*/
85
unsigned int X509v3_addr_get_afi(const IPAddressFamily *f)
86
{
87
- return ((f != NULL &&
88
- f->addressFamily != NULL && f->addressFamily->data != NULL)
89
- ? ((f->addressFamily->data[0] << 8) | (f->addressFamily->data[1]))
90
- : 0);
+ if (f == NULL
+ || f->addressFamily == NULL
+ || f->addressFamily->data == NULL
+ || f->addressFamily->length < 2)
91
+ return 0;
92
+ return (f->addressFamily->data[0] << 8) | f->addressFamily->data[1];
93
}
94
95
/*
0 commit comments