mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Fix xspy_get_permissions -- you can't increment the perms pointer when
iterating and expect to be able to free that pointer afterwards. Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
c9d2f9fc59
commit
8b8e97bb5b
1 file changed
+6
-5
@@ -272,11 +272,12 @@ static PyObject *xspy_get_permissions(XsHandle *self, PyObject *args)
|
||||
|
||||
if (perms) {
|
||||
PyObject *val = PyList_New(perms_n);
|
||||
for (i = 0; i < perms_n; i++, perms++) {
|
||||
PyObject *p = Py_BuildValue("{s:i,s:i,s:i}",
|
||||
"dom", perms->id,
|
||||
"read", perms->perms & XS_PERM_READ,
|
||||
"write",perms->perms & XS_PERM_WRITE);
|
||||
for (i = 0; i < perms_n; i++) {
|
||||
PyObject *p =
|
||||
Py_BuildValue("{s:i,s:i,s:i}",
|
||||
"dom", perms[i].id,
|
||||
"read", perms[i].perms & XS_PERM_READ,
|
||||
"write", perms[i].perms & XS_PERM_WRITE);
|
||||
PyList_SetItem(val, i, p);
|
||||
}
|
||||
|
||||
|
||||