Added sanity check
This commit is contained in:
parent
d6877b995c
commit
7c6bd1e36b
1 changed files with 5 additions and 3 deletions
|
@ -87,10 +87,12 @@ struct MultiAddress* multiaddress_new_from_string(const char* straddress)//Const
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiaddress_is_ip(const struct MultiAddress* in) {
|
int multiaddress_is_ip(const struct MultiAddress* in) {
|
||||||
int byte = in->bytes[0];
|
if (in->bytes > 0) {
|
||||||
|
int byte = in->bytes[0];
|
||||||
|
|
||||||
if (byte == 4 || byte == 41)
|
if (byte == 4 || byte == 41)
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int multiaddress_is_ip4(const struct MultiAddress* in) {
|
int multiaddress_is_ip4(const struct MultiAddress* in) {
|
||||||
|
|
Loading…
Reference in a new issue