]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
(3.3->default) Issue #17269: Workaround for a platform bug in getaddrinfo on OSX
authorRonald Oussoren <ronaldoussoren@mac.com>
Fri, 24 May 2013 11:51:21 +0000 (13:51 +0200)
committerRonald Oussoren <ronaldoussoren@mac.com>
Fri, 24 May 2013 11:51:21 +0000 (13:51 +0200)
Without this patch socket.getaddrinfo crashed when called
with some unusual argument combinations.

1  2 
Lib/test/test_socket.py
Misc/NEWS
Modules/socketmodule.c

index 546d79309128e863832cf11abb32fdf7a62588e8,546a10d23a7f733cde417539bcc10ab8626a9b2c..a2de398c80d6f560eb76cffbee5f2d15bbfc69c9
@@@ -1201,9 -1166,12 +1201,12 @@@ class GeneralModuleTests(unittest.TestC
          # Issue #6697.
          self.assertRaises(UnicodeEncodeError, socket.getaddrinfo, 'localhost', '\uD800')
  
+         # Issue 17269
+         socket.getaddrinfo("localhost", None, 0, 0, 0, socket.AI_NUMERICSERV)
      def test_getnameinfo(self):
          # only IP addresses are allowed
 -        self.assertRaises(socket.error, socket.getnameinfo, ('mail.python.org',0), 0)
 +        self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
  
      @unittest.skipUnless(support.is_resource_enabled('network'),
                           'network is not enabled')
diff --cc Misc/NEWS
index de8b8cea391e6f788a253ca59c267daa69e89a75,125b153ee70fe15a6e837c3c707196e85bfec979..7a4ac3fba4c9796c17a296fc0e35d641fbe6b6e7
+++ b/Misc/NEWS
@@@ -96,38 -112,6 +96,41 @@@ Core and Builtin
  Library
  -------
  
++- Issue #17269: Workaround for socket.getaddrinfo crash on MacOS X
++  with port None or "0" and flags AI_NUMERICSERV.
++
 +- Issue #16986: ElementTree now correctly parses a string input not only when
 +  an internal XML encoding is UTF-8 or US-ASCII.
 +
 +- Issue #17996: socket module now exposes AF_LINK constant on BSD and OSX.
 +
 +- Issue #17900: Allowed pickling of recursive OrderedDicts.  Decreased pickled
 +  size and pickling time.
 +
 +- Issue #17914: Add os.cpu_count(). Patch by Yogesh Chaudhari, based on an
 +  initial patch by Trent Nelson.
 +
 +- Issue #17812: Fixed quadratic complexity of base64.b32encode().
 +  Optimize base64.b32encode() and base64.b32decode() (speed up to 3x).
 +
 +- Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of
 +  service using certificates with many wildcards (CVE-2013-2099).
 +
 +- Issue #15758: Fix FileIO.readall() so it no longer has O(n**2) complexity.
 +
 +- Issue #14596: The struct.Struct() objects now use more compact implementation.
 +
 +- Issue #17981: Closed socket on error in SysLogHandler.
 +
 +- Issue #17964: Fix os.sysconf(): the return type of the C sysconf() function
 +  is long, not int.
 +
 +- Fix typos in the multiprocessing module.
 +
 +- Issue #17754: Make ctypes.util.find_library() independent of the locale.
 +
 +- Issue #17968: Fix memory leak in os.listxattr().
 +
  - Issue #17606: Fixed support of encoded byte strings in the XMLGenerator
    characters() and ignorableWhitespace() methods.  Original patch by Sebastian
    Ortiz Vasquez.
Simple merge