aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-09-24 19:57:35 -0700
committerGuy Harris <guy@alum.mit.edu>2017-09-25 02:58:36 +0000
commit7bb3df70b12efb697fdcec0eaabf879120db8dfa (patch)
treec98bd4e7e8b426946a92ee8fb590dde347538a60
parent2558728ff9b22c42db7f82d4d8c82f3cec75aa64 (diff)
pidl: use ndr_push_charset_to_null() when [to_null] keyword is used in IDL
Pick up change from Samba: commit d30b008a642c9bb0d85519f42aef56a53e44cc77 Author: G√ľnther Deschner <gd@samba.org> Date: Mon Jan 23 14:50:45 2017 +0100 pidl: use ndr_push_charset_to_null() when [to_null] keyword is used in IDL Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Change-Id: I26d53e3c4d0aa9fc959f2d9f0455e480c6cd45e2 Reviewed-on: https://code.wireshark.org/review/23695 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--tools/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 94f4855..87ef6ce 100644
--- a/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -636,7 +636,11 @@ sub ParseElementPushLevel
# Allow speedups for arrays of scalar types
if (is_charset_array($e,$l)) {
- $self->pidl("NDR_CHECK(ndr_push_charset($ndr, $ndr_flags, $var_name, $length, sizeof(" . mapTypeName($nl->{DATA_TYPE}) . "), CH_$e->{PROPERTIES}->{charset}));");
+ if ($l->{IS_TO_NULL}) {
+ $self->pidl("NDR_CHECK(ndr_push_charset_to_null($ndr, $ndr_flags, $var_name, $length, sizeof(" . mapTypeName($nl->{DATA_TYPE}) . "), CH_$e->{PROPERTIES}->{charset}));");
+ } else {
+ $self->pidl("NDR_CHECK(ndr_push_charset($ndr, $ndr_flags, $var_name, $length, sizeof(" . mapTypeName($nl->{DATA_TYPE}) . "), CH_$e->{PROPERTIES}->{charset}));");
+ }
return;
} elsif (has_fast_array($e,$l)) {
$self->pidl("NDR_CHECK(ndr_push_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));");