[PATCH] libwbclient clear pointer on bad read

Matthew Newton mcn4 at leicester.ac.uk
Tue Jan 27 13:46:07 MST 2015


On Tue, Jan 27, 2015 at 09:27:14PM +0100, Volker Lendecke wrote:
> On Tue, Jan 27, 2015 at 09:26:06PM +0100, Stefan (metze) Metzmacher wrote:
> > Am 27.01.2015 um 21:06 schrieb Volker Lendecke:
> > > On Fri, Jan 23, 2015 at 12:45:50PM +0000, Matthew Newton wrote:
> > >>   ... at end of usage:
> > >>
> > >>   wbcFreeContext(ctx);
> > >>
> > >> which would mean updating all the public functions in libwbclient
> > >> to have an extra 'ctx' passed to them?
> > >>
> > >> The wbcContext would contain the fd, is_privileged, etc data, so
> > >> all held in the calling process/thread.
> > >>
> > >> Or did you have something else in mind?
> > > 
> > > Not, that's pretty much what I had in mind. Although I'd not
> > > change the existing functions but create a complete set of
> > > new functions with some function name prefix/postfix. Not
> > > sure about a good suggestion here. The existing functions
> > > would refence one global context and mutex its use.
> > 
> > 
> > Maybe
> > 
> > struct wbcContext *ctx = NULL;
> > 
...
> 
> Looks good to me from a naming perspective :-)

Great, thanks both - I'll hack around on that basis :)

Matthew


-- 
Matthew Newton, Ph.D. <mcn4 at le.ac.uk>

Systems Specialist, Infrastructure Services,
I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom

For IT help contact helpdesk extn. 2253, <ithelp at le.ac.uk>


More information about the samba-technical mailing list