Added sanity check

This commit is contained in:
John Jones 2017-04-27 11:09:18 -05:00
parent d6877b995c
commit 7c6bd1e36b

View file

@ -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) {
if (in->bytes > 0) {
int byte = 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) {