summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_parse/parse_reg.c12
-rw-r--r--source3/rpc_parse/parse_shutdown.c13
2 files changed, 20 insertions, 5 deletions
diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c
index 332f38ab26..c9e09b6528 100644
--- a/source3/rpc_parse/parse_reg.c
+++ b/source3/rpc_parse/parse_reg.c
@@ -1484,8 +1484,10 @@ void init_reg_q_shutdown(REG_Q_SHUTDOWN *q_u, const char *msg,
q_u->server = TALLOC_P( get_talloc_ctx(), uint16 );
*q_u->server = 0x1;
- q_u->message = TALLOC_P( get_talloc_ctx(), UNISTR4 );
- init_unistr4( q_u->message, msg, UNI_FLAGS_NONE );
+ if ( msg && *msg ) {
+ q_u->message = TALLOC_P( get_talloc_ctx(), UNISTR4 );
+ init_unistr4( q_u->message, msg, UNI_FLAGS_NONE );
+ }
q_u->timeout = timeout;
@@ -1535,6 +1537,8 @@ BOOL reg_io_q_shutdown(const char *desc, REG_Q_SHUTDOWN *q_u, prs_struct *ps,
if (!prs_pointer("server", ps, depth, (void**)&q_u->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16))
return False;
+ if (!prs_align(ps))
+ return False;
if (!prs_pointer("message", ps, depth, (void**)&q_u->message, sizeof(UNISTR4), (PRS_POINTER_CAST)prs_unistr4))
return False;
@@ -1593,6 +1597,8 @@ BOOL reg_io_q_shutdown_ex(const char *desc, REG_Q_SHUTDOWN_EX *q_u, prs_struct *
if (!prs_pointer("server", ps, depth, (void**)&q_u->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16))
return False;
+ if (!prs_align(ps))
+ return False;
if (!prs_pointer("message", ps, depth, (void**)&q_u->message, sizeof(UNISTR4), (PRS_POINTER_CAST)prs_unistr4))
return False;
@@ -1666,6 +1672,8 @@ BOOL reg_io_q_abort_shutdown(const char *desc, REG_Q_ABORT_SHUTDOWN *q_u,
if (!prs_pointer("server", ps, depth, (void**)&q_u->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16))
return False;
+ if (!prs_align(ps))
+ return False;
return True;
}
diff --git a/source3/rpc_parse/parse_shutdown.c b/source3/rpc_parse/parse_shutdown.c
index 00daeaaaee..eaed686012 100644
--- a/source3/rpc_parse/parse_shutdown.c
+++ b/source3/rpc_parse/parse_shutdown.c
@@ -34,8 +34,10 @@ void init_shutdown_q_init(SHUTDOWN_Q_INIT *q_s, const char *msg,
q_s->server = TALLOC_P( get_talloc_ctx(), uint16 );
*q_s->server = 0x1;
- q_s->message = TALLOC_P( get_talloc_ctx(), UNISTR4 );
- init_unistr4( q_s->message, msg, UNI_FLAGS_NONE );
+ if ( msg && *msg ) {
+ q_s->message = TALLOC_P( get_talloc_ctx(), UNISTR4 );
+ init_unistr4( q_s->message, msg, UNI_FLAGS_NONE );
+ }
q_s->timeout = timeout;
@@ -84,6 +86,8 @@ BOOL shutdown_io_q_init(const char *desc, SHUTDOWN_Q_INIT *q_s, prs_struct *ps,
if (!prs_pointer("server", ps, depth, (void**)&q_s->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16))
return False;
+ if (!prs_align(ps))
+ return False;
if (!prs_pointer("message", ps, depth, (void**)&q_s->message, sizeof(UNISTR4), (PRS_POINTER_CAST)prs_unistr4))
return False;
@@ -99,7 +103,6 @@ BOOL shutdown_io_q_init(const char *desc, SHUTDOWN_Q_INIT *q_s, prs_struct *ps,
if (!prs_uint8("reboot ", ps, depth, &(q_s->reboot)))
return False;
-
return True;
}
@@ -142,6 +145,8 @@ BOOL shutdown_io_q_init_ex(const char *desc, SHUTDOWN_Q_INIT_EX * q_s, prs_struc
if (!prs_pointer("server", ps, depth, (void**)&q_s->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16))
return False;
+ if (!prs_align(ps))
+ return False;
if (!prs_pointer("message", ps, depth, (void**)&q_s->message, sizeof(UNISTR4), (PRS_POINTER_CAST)prs_unistr4))
return False;
@@ -214,6 +219,8 @@ BOOL shutdown_io_q_abort(const char *desc, SHUTDOWN_Q_ABORT *q_s,
if (!prs_pointer("server", ps, depth, (void**)&q_s->server, sizeof(uint16), (PRS_POINTER_CAST)prs_uint16))
return False;
+ if (!prs_align(ps))
+ return False;
return True;
}