summaryrefslogtreecommitdiff
path: root/source4/rpc_server/netlogon
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2010-02-22 18:47:34 -0500
committerSimo Sorce <idra@samba.org>2010-02-22 18:48:36 -0500
commitdbcc7ad7e4efc550b6937647995e8d74fe538d35 (patch)
tree413787c534ca234ba5ca585d4f43f073796880df /source4/rpc_server/netlogon
parent6c0cd488e5998b058ce472cfb0f41f11dc19327b (diff)
downloadsamba-dbcc7ad7e4efc550b6937647995e8d74fe538d35.tar.gz
samba-dbcc7ad7e4efc550b6937647995e8d74fe538d35.tar.bz2
samba-dbcc7ad7e4efc550b6937647995e8d74fe538d35.zip
s4:netlogon fix segfault
Diffstat (limited to 'source4/rpc_server/netlogon')
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index de741d5284..417035e8a2 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -1707,7 +1707,7 @@ static WERROR dcesrv_netr_DsrEnumerateDomainTrusts(struct dcesrv_call_state *dce
const char * const dom_attrs[] = { "objectSid", "objectGUID", NULL };
struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx;
const char *dnsdomain = lp_dnsdomain(lp_ctx);
- char *p;
+ const char *p;
WERROR werr;
if (r->in.trust_flags & 0xFFFFFE00) {
@@ -1715,18 +1715,25 @@ static WERROR dcesrv_netr_DsrEnumerateDomainTrusts(struct dcesrv_call_state *dce
}
/* TODO: turn to hard check once we are sure this is 100% correct */
- p = strchr(r->in.server_name, '.');
- if (!p) {
+ if (!r->in.server_name) {
DEBUG(3, ("Invalid domain! Expected name in domain [%s]. "
- "But received [%s]!\n",
- dnsdomain, r->in.server_name));
- }
- p++;
- if (strcasecmp(p, dnsdomain)) {
- DEBUG(3, ("Invalid domain! Expected name in domain [%s]. "
- "But received [%s]!\n",
- dnsdomain, r->in.server_name));
- }
+ "But received NULL!\n", dnsdomain));
+ } else {
+ p = strchr(r->in.server_name, '.');
+ if (!p) {
+ DEBUG(3, ("Invalid domain! Expected name in domain "
+ "[%s]. But received [%s]!\n",
+ dnsdomain, r->in.server_name));
+ p = r->in.server_name;
+ } else {
+ p++;
+ }
+ if (strcasecmp(p, dnsdomain)) {
+ DEBUG(3, ("Invalid domain! Expected name in domain "
+ "[%s]. But received [%s]!\n",
+ dnsdomain, r->in.server_name));
+ }
+ }
ZERO_STRUCT(r->out);