summaryrefslogtreecommitdiff
path: root/source4/pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-03-28 22:52:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:40 -0500
commitcbd42dc5a1a296d0f4038448933d68bc4b94ff22 (patch)
treebd5cdd7fba40459d7cfc430188b578f9b211a829 /source4/pidl
parent256054f4e12ddd2d65734cda8a33ee24e50931e8 (diff)
downloadsamba-cbd42dc5a1a296d0f4038448933d68bc4b94ff22.tar.gz
samba-cbd42dc5a1a296d0f4038448933d68bc4b94ff22.tar.bz2
samba-cbd42dc5a1a296d0f4038448933d68bc4b94ff22.zip
r22004: Check for dereferencing null pointers.
Patch by Ronnie Sahlberg. (This used to be commit fa5722111dede37d0d6f9a9d227b7ec3ae28f1d4)
Diffstat (limited to 'source4/pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
index e6dd954b74..51e3933013 100644
--- a/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
@@ -162,8 +162,12 @@ sub Enum($$$)
pidl_code "$dissectorname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)";
pidl_code "{";
indent;
- pidl_code "g$e->{BASE_TYPE} parameter;";
+ pidl_code "g$e->{BASE_TYPE} parameter=0;";
+ pidl_code "if(param){";
+ indent;
pidl_code "parameter=(g$e->{BASE_TYPE})*param;";
+ deindent;
+ pidl_code "}";
pidl_code "offset = dissect_ndr_$e->{BASE_TYPE}(tvb, offset, pinfo, tree, drep, hf_index, &parameter);";
pidl_code "if(param){";
indent;