The Samba-Bugzilla – Attachment 8074 Details for
Bug 9259
rodc join fails complaining that it can't find a RWDC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for v3-5-test/v3-4-test
tmp35.diff (text/plain), 3.84 KB, created by
Stefan Metzmacher
on 2012-10-15 06:52:18 UTC
(
hide
)
Description:
Patch for v3-5-test/v3-4-test
Filename:
MIME Type:
Creator:
Stefan Metzmacher
Created:
2012-10-15 06:52:18 UTC
Size:
3.84 KB
patch
obsolete
>From 573396b4ae7e29b0714ca838fd8159276b02b735 Mon Sep 17 00:00:00 2001 >From: Matthieu Patou <mat@matws.net> >Date: Thu, 27 Sep 2012 01:22:57 -0700 >Subject: [PATCH] lib-addns: ensure that allocated buffer are pre set to 0 > (bug #9259) > >It avoid bugs when one of the buffer is supposed to contain a string >that is not null terminated (ie. label->label) and that we don't force >the last byte to 0. >(similar to commit 03c4dceaab82ca2c60c9ce0e09fddd071f98087b) >--- > source3/libaddns/dnsmarshall.c | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > >diff --git a/source3/libaddns/dnsmarshall.c b/source3/libaddns/dnsmarshall.c >index 5530290..b2e84eb 100644 >--- a/source3/libaddns/dnsmarshall.c >+++ b/source3/libaddns/dnsmarshall.c >@@ -27,7 +27,7 @@ struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx) > { > struct dns_buffer *result; > >- if (!(result = talloc(mem_ctx, struct dns_buffer))) { >+ if (!(result = talloc_zero(mem_ctx, struct dns_buffer))) { > return NULL; > } > >@@ -39,7 +39,7 @@ struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx) > */ > result->size = 2; > >- if (!(result->data = TALLOC_ARRAY(result, uint8, result->size))) { >+ if (!(result->data = TALLOC_ZERO_ARRAY(result, uint8, result->size))) { > TALLOC_FREE(result); > return NULL; > } >@@ -216,14 +216,14 @@ static void dns_unmarshall_label(TALLOC_CTX *mem_ctx, > return; > } > >- if (!(label = talloc(mem_ctx, struct dns_domain_label))) { >+ if (!(label = talloc_zero(mem_ctx, struct dns_domain_label))) { > buf->error = ERROR_DNS_NO_MEMORY; > return; > } > > label->len = len; > >- if (!(label->label = TALLOC_ARRAY(label, char, len+1))) { >+ if (!(label->label = TALLOC_ZERO_ARRAY(label, char, len+1))) { > buf->error = ERROR_DNS_NO_MEMORY; > goto error; > } >@@ -250,7 +250,7 @@ void dns_unmarshall_domain_name(TALLOC_CTX *mem_ctx, > > if (!ERR_DNS_IS_OK(buf->error)) return; > >- if (!(name = talloc(mem_ctx, struct dns_domain_name))) { >+ if (!(name = talloc_zero(mem_ctx, struct dns_domain_name))) { > buf->error = ERROR_DNS_NO_MEMORY; > return; > } >@@ -281,7 +281,7 @@ static void dns_unmarshall_question(TALLOC_CTX *mem_ctx, > > if (!(ERR_DNS_IS_OK(buf->error))) return; > >- if (!(q = talloc(mem_ctx, struct dns_question))) { >+ if (!(q = talloc_zero(mem_ctx, struct dns_question))) { > buf->error = ERROR_DNS_NO_MEMORY; > return; > } >@@ -314,7 +314,7 @@ static void dns_unmarshall_rr(TALLOC_CTX *mem_ctx, > > if (!(ERR_DNS_IS_OK(buf->error))) return; > >- if (!(r = talloc(mem_ctx, struct dns_rrec))) { >+ if (!(r = talloc_zero(mem_ctx, struct dns_rrec))) { > buf->error = ERROR_DNS_NO_MEMORY; > return; > } >@@ -329,7 +329,7 @@ static void dns_unmarshall_rr(TALLOC_CTX *mem_ctx, > if (!(ERR_DNS_IS_OK(buf->error))) return; > > if (r->data_length != 0) { >- if (!(r->data = TALLOC_ARRAY(r, uint8, r->data_length))) { >+ if (!(r->data = TALLOC_ZERO_ARRAY(r, uint8, r->data_length))) { > buf->error = ERROR_DNS_NO_MEMORY; > return; > } >@@ -406,22 +406,22 @@ DNS_ERROR dns_unmarshall_request(TALLOC_CTX *mem_ctx, > err = ERROR_DNS_NO_MEMORY; > > if ((req->num_questions != 0) && >- !(req->questions = TALLOC_ARRAY(req, struct dns_question *, >+ !(req->questions = TALLOC_ZERO_ARRAY(req, struct dns_question *, > req->num_questions))) { > goto error; > } > if ((req->num_answers != 0) && >- !(req->answers = TALLOC_ARRAY(req, struct dns_rrec *, >+ !(req->answers = TALLOC_ZERO_ARRAY(req, struct dns_rrec *, > req->num_answers))) { > goto error; > } > if ((req->num_auths != 0) && >- !(req->auths = TALLOC_ARRAY(req, struct dns_rrec *, >+ !(req->auths = TALLOC_ZERO_ARRAY(req, struct dns_rrec *, > req->num_auths))) { > goto error; > } > if ((req->num_additionals != 0) && >- !(req->additionals = TALLOC_ARRAY(req, struct dns_rrec *, >+ !(req->additionals = TALLOC_ZERO_ARRAY(req, struct dns_rrec *, > req->num_additionals))) { > goto error; > } >-- >1.7.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
obnox
:
review+
Actions:
View
Attachments on
bug 9259
:
8060
|
8073
| 8074