PR: 2411
Submitted by: Rob Austein <sra@hactrn.net> Reviewed by: steve Fix corner cases in RFC3779 code.
This commit is contained in:
parent
2fcf251d3d
commit
19091ac236
@ -177,12 +177,18 @@ static int i2r_address(BIO *out,
|
|||||||
unsigned char addr[ADDR_RAW_BUF_LEN];
|
unsigned char addr[ADDR_RAW_BUF_LEN];
|
||||||
int i, n;
|
int i, n;
|
||||||
|
|
||||||
|
if (bs->length < 0)
|
||||||
|
return 0;
|
||||||
switch (afi) {
|
switch (afi) {
|
||||||
case IANA_AFI_IPV4:
|
case IANA_AFI_IPV4:
|
||||||
|
if (bs->length > 4)
|
||||||
|
return 0;
|
||||||
addr_expand(addr, bs, 4, fill);
|
addr_expand(addr, bs, 4, fill);
|
||||||
BIO_printf(out, "%d.%d.%d.%d", addr[0], addr[1], addr[2], addr[3]);
|
BIO_printf(out, "%d.%d.%d.%d", addr[0], addr[1], addr[2], addr[3]);
|
||||||
break;
|
break;
|
||||||
case IANA_AFI_IPV6:
|
case IANA_AFI_IPV6:
|
||||||
|
if (bs->length > 16)
|
||||||
|
return 0;
|
||||||
addr_expand(addr, bs, 16, fill);
|
addr_expand(addr, bs, 16, fill);
|
||||||
for (n = 16; n > 1 && addr[n-1] == 0x00 && addr[n-2] == 0x00; n -= 2)
|
for (n = 16; n > 1 && addr[n-1] == 0x00 && addr[n-2] == 0x00; n -= 2)
|
||||||
;
|
;
|
||||||
|
@ -372,7 +372,7 @@ static int ASIdentifierChoice_is_canonical(ASIdentifierChoice *choice)
|
|||||||
int v3_asid_is_canonical(ASIdentifiers *asid)
|
int v3_asid_is_canonical(ASIdentifiers *asid)
|
||||||
{
|
{
|
||||||
return (asid == NULL ||
|
return (asid == NULL ||
|
||||||
(ASIdentifierChoice_is_canonical(asid->asnum) ||
|
(ASIdentifierChoice_is_canonical(asid->asnum) &&
|
||||||
ASIdentifierChoice_is_canonical(asid->rdi)));
|
ASIdentifierChoice_is_canonical(asid->rdi)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user