mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-06-25 06:39:04 +08:00
Handle endianness in x509_inet_pton_ipv6()
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
This commit is contained in:
parent
7bd00e0708
commit
b255e21e48
@ -2579,7 +2579,7 @@ static int x509_inet_pton_ipv6(const char *src, void *dst)
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
if (j != 0) {
|
if (j != 0) {
|
||||||
addr[i++] = (x << 8) | (x >> 8); /* htons(x) */
|
addr[i++] = MBEDTLS_IS_BIG_ENDIAN ? x : (x << 8) | (x >> 8);
|
||||||
if (*v == '\0') {
|
if (*v == '\0') {
|
||||||
break;
|
break;
|
||||||
} else if (*v == '.' && (i != 0 || dc != -1) && (i < 7) &&
|
} else if (*v == '.' && (i != 0 || dc != -1) && (i < 7) &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user