Bug in inet_db.erl

Alexey Shchepin alexey@REDACTED
Tue Mar 15 09:10:07 CET 2005


Hi!

On Sat, 05 Mar 2005 01:44:33 +0200, I said:

 AS> Now try to run

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

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

 AS> Quick fix:

Sorry, it was incomplete fix.  Corrected patch:

--- inet_db.erl.orig    Sat Mar  5 01:31:50 2005
+++ inet_db.erl Tue Mar 15 10:58:50 2005
@@ -511,7 +511,12 @@
            case lookup_cname(Domain) of
                [] ->  {error, nxdomain};
                [CName | _] ->
-                   hostent_by_domain(CName, [Domain | Aliases], Type)
+                   case lists:member(CName, [Domain | Aliases]) of
+                        true -> {error, nxdomain};
+                        false ->
+                              hostent_by_domain(CName, [Domain | Aliases],
+                                                 Type)
+                   end
            end;
        Addrs ->
            {ok, make_hostent(Domain, Addrs, Aliases,Type)}
@@ -546,7 +551,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-patches mailing list