[PATCH] tdb: Fix possible crash bugs in the python tdb code.

simo idra at samba.org
Tue Dec 11 09:18:19 MST 2012


On Tue, 2012-12-11 at 17:06 +0100, Andreas Schneider wrote:
> You can't call tdb_error() for tdb_reopen() or tdb_close(), both return
> the error code of close(2) and not a TDB_ERROR!
> 
> Signed-off-by: Andreas Schneider <asn at samba.org>
> ---
>  lib/tdb/pytdb.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/lib/tdb/pytdb.c b/lib/tdb/pytdb.c
> index ae0e6f8..2266d4e 100644
> --- a/lib/tdb/pytdb.c
> +++ b/lib/tdb/pytdb.c
> @@ -164,7 +164,6 @@ static PyObject *obj_reopen(PyTdbObject *self)
>  	int ret;
>  	PyErr_TDB_RAISE_IF_CLOSED(self);
>  	ret = tdb_reopen(self->ctx);
> -	PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
>  	Py_RETURN_NONE;
>  }
>  
> @@ -209,7 +208,6 @@ static PyObject *obj_close(PyTdbObject *self)
>  		Py_RETURN_NONE;
>  	ret = tdb_close(self->ctx);
>  	self->closed = true;
> -	PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
>  	Py_RETURN_NONE;
>  }
>  

Feel free to add my Reviewed-by
however you should get also Jelmer's one as he is the maintener of
python bindings normally.

Simo.
-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list