mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Don't leak a 16k allocation if PyArg_ParseTupleAndKeywords() or the first xc_readconsolering() fail. It is trivial to run throught the processes memory by repeatedly passing junk parameters to this function. In the case that the call to xc_readconsolering() in the while loop fails, reinstate str before breaking out, and passing a spurious pointer to free(). Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Coverity-IDs: 1054984 1055906 CC: Ian Campbell <Ian.Campbell@citrix.com> CC: Ian Jackson <Ian.Jackson@eu.citrix.com> CC: Wei Liu <wei.liu2@citrix.com> CC: Xen Coverity Team <coverity@xen.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
The file test.py here is from the Zope project, and is Copyright (c) 2001, 2002 Zope Corporation and Contributors. This file is released under the Zope Public License, version 2.0, a copy of which is in the file ZPL-2.0.