[PATCH 0/3] drop the SPOOLSS_BUFFER_OK macro

David Disseldorp ddiss at samba.org
Fri Dec 19 10:08:39 MST 2014


#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(-)


More information about the samba-technical mailing list