mirror of
https://github.com/samba-team/samba.git
synced 2025-02-10 13:57:47 +03:00
r19049: Samba 3 client fixes
* Make sure to check for NULL pointers when dealing with [out,unique] before assigning valoues * Detect RPC faults and return immediately (This used to be commit c96dae478c2fee2fede9c853a71c8079bbb8ba47)
This commit is contained in:
parent
91814f4b00
commit
a22d785d7c
@ -57,6 +57,14 @@ sub ParseFunction($$)
|
||||
pidl "\tNDR_PRINT_IN_DEBUG($fn->{NAME}, &r);";
|
||||
pidl "";
|
||||
pidl "status = cli_do_rpc_ndr(cli, mem_ctx, PI_$uif, $ufn, &r, (ndr_pull_flags_fn_t)ndr_pull_$fn->{NAME}, (ndr_push_flags_fn_t)ndr_push_$fn->{NAME});";
|
||||
pidl "";
|
||||
|
||||
pidl "if ( !NT_STATUS_IS_OK(status) ) {";
|
||||
indent;
|
||||
pidl "return status;";
|
||||
deindent;
|
||||
pidl "}";
|
||||
|
||||
pidl "";
|
||||
pidl "if (DEBUGLEVEL >= 10)";
|
||||
pidl "\tNDR_PRINT_OUT_DEBUG($fn->{NAME}, &r);";
|
||||
@ -71,7 +79,16 @@ sub ParseFunction($$)
|
||||
|
||||
fatal($e, "[out] argument is not a pointer or array") if ($e->{LEVELS}[0]->{TYPE} ne "POINTER" and $e->{LEVELS}[0]->{TYPE} ne "ARRAY");
|
||||
|
||||
pidl "*$e->{NAME} = *r.out.$e->{NAME};";
|
||||
if ( ($e->{LEVELS}[0]->{TYPE} eq "POINTER") && ($e->{LEVELS}[0]->{POINTER_TYPE} eq "unique") ) {
|
||||
pidl "if ( $e->{NAME} ) {";
|
||||
indent;
|
||||
pidl "*$e->{NAME} = *r.out.$e->{NAME};";
|
||||
deindent;
|
||||
pidl "}";
|
||||
} else {
|
||||
pidl "*$e->{NAME} = *r.out.$e->{NAME};";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pidl"";
|
||||
|
Loading…
x
Reference in New Issue
Block a user