[PATCH] libwbclient clear pointer on bad read

Matthew Newton mcn4 at leicester.ac.uk
Sun Mar 1 16:59:35 MST 2015


On Sun, Mar 01, 2015 at 12:30:18PM +0100, Volker Lendecke wrote:
> On Tue, Feb 24, 2015 at 10:59:15PM +0000, Matthew Newton wrote:
> > I've updated and attached the patches per your notes - definitely
> > the better way to do things, thanks!
> 
> Ok, this is almost there :-)
> 
> I've attached a patch with the changes I'd propose:

Thanks very much for that.

> In wbclient.c you need a struct winbindd_context forward
> declaration. Otherwise gcc gives nasty warnings, and you end
> up with a different type. wbcContextDestructor() does not
> need the cast anymore.

That will teach me not to submit patches built without a make
clean first - I got no warnings on that when I built it.

> The third one is a functional problem: If you declare 
> 
> static struct wbcContext wbcGlobalCtx;
> 
> in wbclient_internal.h you end up with multiple variables,
> one in each .o file. This is almost certainly not what you
> want.

Oops, thanks. As I wrote it something didn't quite feel right, but
obviously not enough to make me realise what I'd done.

> And the last comment: Can you copy&paste the doxygen
> comments for the wbcCtx functions?

Done.

Updated patches attached - hopefully it fixes these up. I've also
bumped the library version to 0.11 and added the new .sigs file.
The build complained that the major version should be bumped as
well because the two functions wbcRequestResponse and
wbcRequestResponsePriv have changed paramenters, but as they are
internal to the library only (and not in wbclient.h) I don't think
that's necessary?

Thanks!

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>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-winbind-client-library-thread-safe-by-adding-co.patch
Type: text/x-diff
Size: 14777 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150301/99831159/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Use-global-context-for-winbindd_request_response.patch
Type: text/x-diff
Size: 19159 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150301/99831159/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-wbcContext-struct-create-and-free-functions.patch
Type: text/x-diff
Size: 4070 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150301/99831159/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Add-wbcContext-to-wbcRequestResponse.patch
Type: text/x-diff
Size: 3154 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150301/99831159/attachment-0003.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Add-context-versions-of-wbclient-functions.patch
Type: text/x-diff
Size: 84814 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150301/99831159/attachment-0004.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Move-wbc-global-variables-into-global-context-instea.patch
Type: text/x-diff
Size: 8283 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150301/99831159/attachment-0005.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-Update-libwbclient-version-to-0.12.patch
Type: text/x-diff
Size: 12149 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150301/99831159/attachment-0006.patch>


More information about the samba-technical mailing list