Bug in inet_db.erl

Alexey Shchepin <>
Sat Mar 5 00:44:33 CET 2005


Hi!

There exists such domain at this moment:

% host -t srv _xmpp-server._tcp.centova.net
_xmpp-server._tcp.centova.net   CNAME   cluster.centova.net
cluster.centova.net     CNAME   cluster.centova.net
cluster.centova.net     CNAME   cluster.centova.net
cluster.centova.net     CNAME   cluster.centova.net
cluster.centova.net     CNAME   cluster.centova.net
cluster.centova.net     CNAME   cluster.centova.net
cluster.centova.net     CNAME   cluster.centova.net
cluster.centova.net     CNAME   cluster.centova.net
cluster.centova.net     CNAME   cluster.centova.net
cluster.centova.net     CNAME   cluster.centova.net
cluster.centova.net     CNAME   cluster.centova.net
cluster.centova.net     CNAME   cluster.centova.net
Possible CNAME loop

Now try to run

% erl -name test
> inet_res:getbyname("_xmpp-server._tcp.centova.net", srv).

Erlang VM will eat a lot of memory and then produce erl_crash.dump.

Quick fix:

--- inet_db.erl.orig    Sat Mar  5 01:31:50 2005
+++ inet_db.erl Sat Mar  5 01:47:49 2005
@@ -546,7 +546,12 @@
            case res_lookup_type(Domain,?S_CNAME,RRs) of
                [] ->  {error, nxdomain};
                [CName | _] ->
-                   res_hostent_by_domain(CName, [Domain | Aliases], Type, RRs)
+                   case lists:member(CName, [Domain | Aliases]) of
+                       true -> {error, nxdomain};
+                       false ->
+                           res_hostent_by_domain(CName, [Domain | Aliases],
+                                                 Type, RRs)
+                   end
            end;
        Addrs ->
            {ok, make_hostent(Domain, Addrs, Aliases,Type)}





More information about the erlang-bugs mailing list