summaryrefslogtreecommitdiff
path: root/source4/libnet/libnet_become_dc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libnet/libnet_become_dc.c')
-rw-r--r--source4/libnet/libnet_become_dc.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index 19391e7983..332b041e36 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -2465,26 +2465,33 @@ static WERROR becomeDC_drsuapi_pull_partition_recv(struct libnet_BecomeDC_state
if (*r->out.level == 1) {
ctr_level = 1;
ctr1 = &r->out.ctr.ctr1;
- } else if (*r->out.level == 2) {
+ } else if (*r->out.level == 2 &&
+ r->out.ctr.ctr2.mszip1.ts) {
ctr_level = 1;
- ctr1 = r->out.ctr.ctr2.mszip1.ctr1;
+ ctr1 = &r->out.ctr.ctr2.mszip1.ts->ctr1;
} else if (*r->out.level == 6) {
ctr_level = 6;
ctr6 = &r->out.ctr.ctr6;
} else if (*r->out.level == 7 &&
r->out.ctr.ctr7.level == 6 &&
- r->out.ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP) {
+ r->out.ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_MSZIP &&
+ r->out.ctr.ctr7.ctr.mszip6.ts) {
ctr_level = 6;
- ctr6 = r->out.ctr.ctr7.ctr.mszip6.ctr6;
+ ctr6 = &r->out.ctr.ctr7.ctr.mszip6.ts->ctr6;
} else if (*r->out.level == 7 &&
r->out.ctr.ctr7.level == 6 &&
- r->out.ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS) {
+ r->out.ctr.ctr7.type == DRSUAPI_COMPRESSION_TYPE_XPRESS &&
+ r->out.ctr.ctr7.ctr.xpress6.ts) {
ctr_level = 6;
- ctr6 = r->out.ctr.ctr7.ctr.xpress6.ctr6;
+ ctr6 = &r->out.ctr.ctr7.ctr.xpress6.ts->ctr6;
} else {
return WERR_BAD_NET_RESP;
}
+ if (!ctr1 && ! ctr6) {
+ return WERR_BAD_NET_RESP;
+ }
+
if (ctr_level == 6) {
if (!W_ERROR_IS_OK(ctr6->drs_error)) {
return ctr6->drs_error;