Erlang/OTP Forums

Author Message

<  Erlang patches mailing list  ~  Bug in inet_db.erl

alexey at sevcom.net
Posted: Fri Mar 04, 2005 11:53 pm Reply with quote
Guest
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
_at__at_ -546,7 +546,12 _at__at_
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)}



Post generated using Mail2Forum (http://m2f.sourceforge.net)
alexey at sevcom.net
Posted: Tue Mar 15, 2005 8:20 am Reply with quote
Guest
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
_at__at_ -511,7 +511,12 _at__at_
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)}
_at__at_ -546,7 +551,12 _at__at_
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)}


Post generated using Mail2Forum (http://m2f.sourceforge.net)
DELETED
Posted: Mon Apr 09, 2007 4:21 am Reply with quote
Guest
DELETED

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum