summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-dcerpc-ndr.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/epan/dissectors/packet-dcerpc-ndr.c b/epan/dissectors/packet-dcerpc-ndr.c
index c6bef9d41a..a7a557b483 100644
--- a/epan/dissectors/packet-dcerpc-ndr.c
+++ b/epan/dissectors/packet-dcerpc-ndr.c
@@ -45,6 +45,11 @@ dissect_ndr_uint8(tvbuff_t *tvb, gint offset, packet_info *pinfo,
{
dcerpc_info *di;
+ /* Some callers expect us to initialize pdata, even in error conditions, so
+ * do it right away in case we forget later */
+ if (pdata)
+ *pdata = 0;
+
di = (dcerpc_info *)pinfo->private_data;
if (di->conformant_run) {
/* just a run to handle conformant arrays, no scalars to dissect */
@@ -118,6 +123,11 @@ dissect_ndr_uint16(tvbuff_t *tvb, gint offset, packet_info *pinfo,
{
dcerpc_info *di;
+ /* Some callers expect us to initialize pdata, even in error conditions, so
+ * do it right away in case we forget later */
+ if (pdata)
+ *pdata = 0;
+
di = (dcerpc_info *)pinfo->private_data;
if (di->conformant_run) {
/* just a run to handle conformant arrays, no scalars to dissect */
@@ -196,6 +206,11 @@ dissect_ndr_uint32(tvbuff_t *tvb, gint offset, packet_info *pinfo,
{
dcerpc_info *di;
+ /* Some callers expect us to initialize pdata, even in error conditions, so
+ * do it right away in case we forget later */
+ if (pdata)
+ *pdata = 0;
+
di = (dcerpc_info *)pinfo->private_data;
if (di->conformant_run) {
/* just a run to handle conformant arrays, no scalars to dissect */
@@ -327,6 +342,11 @@ dissect_ndr_duint32(tvbuff_t *tvb, gint offset, packet_info *pinfo,
{
dcerpc_info *di;
+ /* Some callers expect us to initialize pdata, even in error conditions, so
+ * do it right away in case we forget later */
+ if (pdata)
+ *pdata = 0;
+
di = (dcerpc_info *)pinfo->private_data;
if (di->conformant_run) {
/* just a run to handle conformant arrays, no scalars to dissect */
@@ -350,6 +370,11 @@ dissect_ndr_uint64(tvbuff_t *tvb, gint offset, packet_info *pinfo,
{
dcerpc_info *di;
+ /* Some callers expect us to initialize pdata, even in error conditions, so
+ * do it right away in case we forget later */
+ if (pdata)
+ *pdata = 0;
+
di = (dcerpc_info *)pinfo->private_data;
if (di->conformant_run) {
/* just a run to handle conformant arrays, no scalars to dissect */
@@ -429,6 +454,11 @@ dissect_ndr_float(tvbuff_t *tvb, gint offset, packet_info *pinfo,
{
dcerpc_info *di;
+ /* Some callers expect us to initialize pdata, even in error conditions, so
+ * do it right away in case we forget later */
+ if (pdata)
+ *pdata = 0;
+
di = (dcerpc_info *)pinfo->private_data;
if (di->conformant_run) {
@@ -451,6 +481,10 @@ dissect_ndr_double(tvbuff_t *tvb, gint offset, packet_info *pinfo,
{
dcerpc_info *di;
+ /* Some callers expect us to initialize pdata, even in error conditions, so
+ * do it right away in case we forget later */
+ if (pdata)
+ *pdata = 0;
di = (dcerpc_info *)pinfo->private_data;
if (di->conformant_run) {
@@ -473,6 +507,11 @@ dissect_ndr_time_t(tvbuff_t *tvb, gint offset, packet_info *pinfo,
{
dcerpc_info *di;
+ /* Some callers expect us to initialize pdata, even in error conditions, so
+ * do it right away in case we forget later */
+ if (pdata)
+ *pdata = 0;
+
di = (dcerpc_info *)pinfo->private_data;
if (di->conformant_run) {
/* just a run to handle conformant arrays, no scalars to dissect */
@@ -494,6 +533,11 @@ dissect_ndr_uuid_t(tvbuff_t *tvb, gint offset, packet_info *pinfo,
{
dcerpc_info *di;
+ /* Some callers expect us to initialize pdata, even in error conditions, so
+ * do it right away in case we forget later */
+ if (pdata)
+ memset(pdata, 0, sizeof(*pdata));
+
di = (dcerpc_info *)pinfo->private_data;
if (di->conformant_run) {
/* just a run to handle conformant arrays, no scalars to dissect */