ia64/xen-unstable

changeset 10160:4c14bca8ca93

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>
author emellor@leeni.uk.xensource.com
date Tue May 23 16:14:03 2006 +0100 (2006-05-23)
parents 606db2959bd6
children 956f7c5b1c1f
files tools/python/xen/lowlevel/xs/xs.c
line diff
     1.1 --- a/tools/python/xen/lowlevel/xs/xs.c	Tue May 23 12:05:08 2006 +0100
     1.2 +++ b/tools/python/xen/lowlevel/xs/xs.c	Tue May 23 16:14:03 2006 +0100
     1.3 @@ -272,11 +272,12 @@ static PyObject *xspy_get_permissions(Xs
     1.4  
     1.5      if (perms) {
     1.6          PyObject *val = PyList_New(perms_n);
     1.7 -        for (i = 0; i < perms_n; i++, perms++) {
     1.8 -            PyObject *p = Py_BuildValue("{s:i,s:i,s:i}",
     1.9 -                                        "dom",  perms->id,
    1.10 -                                        "read", perms->perms & XS_PERM_READ,
    1.11 -                                        "write",perms->perms & XS_PERM_WRITE);
    1.12 +        for (i = 0; i < perms_n; i++) {
    1.13 +            PyObject *p =
    1.14 +                Py_BuildValue("{s:i,s:i,s:i}",
    1.15 +                              "dom",   perms[i].id,
    1.16 +                              "read",  perms[i].perms & XS_PERM_READ,
    1.17 +                              "write", perms[i].perms & XS_PERM_WRITE);
    1.18              PyList_SetItem(val, i, p);
    1.19          }
    1.20