Commit Graph

12 Commits

Author SHA1 Message Date
Gregor Jasny 7db1afd38f Fix integer shift overflow if both tcp_socket and udp_socket are set
The problem occurs if at the start of the loop the sockindex is at the
last valid ARES_GETSOCK_MAXNUM position. If then both udp_socket and
tcp_socket are valid, sockindex gets incremented for UDP first and
points one entry behind the array for the tcp block.
So the fix is to check after every increment of sockindex if it is still
valid.

Fix Coverity error CID 56878

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2014-09-30 16:49:49 +01:00
Yang Tse a1035276c1 Header inclusion clean-up
Remove header inclusions already done in setup_once.h
2012-12-14 18:25:56 +01:00
Daniel Stenberg 63627fa5ab remove all $Id$ lines 2010-03-27 19:42:02 +01:00
Yang Tse 907b09ccd0 fix compiler warning 2010-03-11 18:53:42 +00:00
Yang Tse a82a8fbf82 Renamed c-ares setup.h to ares_setup.h 2009-11-02 11:55:53 +00:00
Steinar H. Gunderson ff7137ad74 Port the TCP socket fix made in ares_fds() to ares_getsock() as well. 2007-09-29 19:26:59 +00:00
Steinar H. Gunderson 04e49e09dc Previously, processing a large batch of timeouts was O(n^2) in the number of
outstanding queries, and processing a DNS response packet was O(n) in the
number of outstanding queries. To speed things up in Google, we added a few circular,
doubly-linked lists of queries that are hash-bucketed based on
the attributes we care about, so most important operations are now O(1).

It might be that the number of buckets are higher than most people would need,
but on a quick calculation it should only be 100kB or so even on a 64-bit
system, so I've let it stay as-is.
2007-09-29 18:18:47 +00:00
Yang Tse c8033a21a1 update copyright year 2007-04-03 18:25:18 +00:00
Gisle Vanem a627160041 Removed inclusion of <sys/types.h> in .c-files
since it's already included through "setup.h".
2007-02-26 04:33:19 +00:00
Daniel Stenberg 04cb824483 avoid an overflow if an excessive amount of servers are used 2006-10-12 16:47:50 +00:00
Daniel Stenberg 19fb255f9e Ravi Pratap fixed ares_getsock() to actually return the proper bitmap and
not always zero!
2006-08-03 18:20:45 +00:00
Daniel Stenberg 8d63eb75a9 Added ares_getsock() to extract sockets to wait for action on, without being
limited to select().
2005-12-22 15:27:41 +00:00