This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
bug: weak constraint of ipv4 and incorrect code logic in hostname_from_ip #405
Labels
type/bug
This issue reports a bug.
rdsn/src/core/core/utils.cpp
Line 116 in 07f2e65
addr.from_string_ipv4
is too weak to limit the ipv4 address, it only judges by the format of addresses, and don't care about if its value valid. So this function can't limit ip address like123.456.789.123
rdsn/src/core/core/utils.cpp
Line 130 in 07f2e65
rdsn/src/core/tests/hostname_test.cpp
Line 40 in ca49482
This unit test should not be done like this,
address.type() != HOST_TYPE_IPV4
can't tell if its value valid, becauseaddress.type
has been assigned before it was passed in.The text was updated successfully, but these errors were encountered: