From c28074da329d7370e978df65e899c8cf834307eb Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 17 Oct 2007 08:26:55 +0200 Subject: r25674: 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 (This used to be commit 7203f717a676a741e49f96f2d477f4f459575caf) --- source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm index 9c3f01ad93..f6c9a04a8e 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm @@ -91,7 +91,7 @@ sub ParseFunction($$$) 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; } } -- cgit