Author: metze Date: 2007-10-17 08:26:55 +0000 (Wed, 17 Oct 2007) New Revision: 25674
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25674 Log: fix crash bug in pidl generated client code, this could have happend with [in,out,unique] pointers when the clients sends a valid pointer, but the server reponse with a NULL pointer (as samba-3.0.26a do for some calls). I've tested with midl to see how windows handles this situation and also the reverse case where the client sends NULL and the server reposnse with non-NULL. It appears that midl generated code just ignores this and only copies the result if both pointers are non-NULL. metze Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm Changeset: Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm =================================================================== --- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm 2007-10-16 17:23:34 UTC (rev 25673) +++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm 2007-10-17 08:26:55 UTC (rev 25674) @@ -91,7 +91,7 @@ if ($e->{LEVELS}[0]->{TYPE} eq "POINTER") { $level = 1; if ($e->{LEVELS}[0]->{POINTER_TYPE} ne "ref") { - $self->pidl("if ( $e->{NAME} ) {"); + $self->pidl("if ($e->{NAME} && r.out.$e->{NAME}) {"); $self->indent; } }
