[PATCH 0/3] drop the SPOOLSS_BUFFER_OK macro
Guenther Deschner
gd at samba.org
Fri Dec 19 10:50:57 MST 2014
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Sorry David, NAK on these as well :)
The macros have been invented just for the purpose of avoiding to put
manual checks everywhere. If you see a problem with the macros we
should better fix them but please let's not go down the road again of
putting all these checks back in the spoolss server explicitly.
Thanks,
Guenther
On 19/12/14 18:08, David Disseldorp wrote:
> #define SPOOLSS_BUFFER_OK(val_true,val_false) ((r->in.offered >=
> *r->out.needed)?val_true:val_false)
>
> This macro has a couple of issues: - It assumes the existence of
> the r->in.offered and r->out.needed local variables. - In most
> cases it is called two or three times successively, meaning that
> the bounds check expression is unnecessarily evaluated multiple
> times.
>
> These patches are based atop the 10984 fixes, which just went into
> master.
>
> Cheers, David
>
> --
>
> source3/rpc_server/spoolss/srv_spoolss_nt.c | 133
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------
>
>
>
1 file changed, 88 insertions(+), 45 deletions(-)
>
- --
Günther Deschner GPG-ID: 8EE11688
Red Hat gdeschner at redhat.com
Samba Team gd at samba.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iEYEARECAAYFAlSUZXkACgkQSOk3aI7hFogD4ACfXHJi0vCqrHNGg1ctEKN3gWjR
GCYAoJA1IAP71aMEW3SVl3Nj/d6Xsy7r
=cQot
-----END PGP SIGNATURE-----
More information about the samba-technical
mailing list