[New-bugs-announce] [issue15219] Leak in "_hashlib.new()" if argument is not a string

Michael Fötsch report at bugs.python.org
Thu Jun 28 18:45:53 CEST 2012

New submission from Michael Fötsch <foetsch at yahoo.com>:

If the "name" argument to "_hashlib.new()" is not a string, the reference count for the "string" argument is not decremented.

In the file "Modules/_hashopenssl.c", function "EVP_new()", a call to "PyBuffer_Release()" is missing:

  if (!PyArg_Parse(name_obj, "s", &name)) {
+     PyBuffer_Release(&view);
      PyErr_SetString(PyExc_TypeError, "name must be a string");
      return NULL;

components: Library (Lib)
messages: 164274
nosy: mfoetsch
priority: normal
severity: normal
status: open
title: Leak in "_hashlib.new()" if argument is not a string
type: resource usage
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list