diff options
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/ldap/ldap.c | 8 | ||||
-rw-r--r-- | source4/libcli/nbt/nbtsocket.c | 3 | ||||
-rw-r--r-- | source4/libcli/resolve/resolve.c | 2 | ||||
-rw-r--r-- | source4/libcli/security/dom_sid.c | 2 | ||||
-rw-r--r-- | source4/libcli/smb2/request.c | 2 | ||||
-rw-r--r-- | source4/libcli/util/asn1.c | 2 |
6 files changed, 10 insertions, 9 deletions
diff --git a/source4/libcli/ldap/ldap.c b/source4/libcli/ldap/ldap.c index 64f6f90d31..06ff000acf 100644 --- a/source4/libcli/ldap/ldap.c +++ b/source4/libcli/ldap/ldap.c @@ -497,7 +497,7 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ct static const char *blob2string_talloc(TALLOC_CTX *mem_ctx, DATA_BLOB blob) { - char *result = talloc_size(mem_ctx, blob.length+1); + char *result = talloc_array(mem_ctx, char, blob.length+1); memcpy(result, blob.data, blob.length); result[blob.length] = '\0'; return result; @@ -955,7 +955,7 @@ NTSTATUS ldap_decode(struct asn1_data *data, struct ldap_message *msg) return NT_STATUS_LDAP(LDAP_PROTOCOL_ERROR); } if (pwlen != 0) { - char *pw = talloc_size(msg, pwlen+1); + char *pw = talloc_array(msg, char, pwlen+1); if (!pw) { return NT_STATUS_LDAP(LDAP_OPERATIONS_ERROR); } @@ -1162,7 +1162,7 @@ NTSTATUS ldap_decode(struct asn1_data *data, struct ldap_message *msg) if (len == -1) { return NT_STATUS_LDAP(LDAP_PROTOCOL_ERROR); } - dn = talloc_size(msg, len+1); + dn = talloc_array(msg, char, len+1); if (dn == NULL) break; asn1_read(data, dn, len); @@ -1198,7 +1198,7 @@ NTSTATUS ldap_decode(struct asn1_data *data, struct ldap_message *msg) if (len == -1) { return NT_STATUS_LDAP(LDAP_PROTOCOL_ERROR); } - newsup = talloc_size(msg, len+1); + newsup = talloc_array(msg, char, len+1); if (newsup == NULL) { return NT_STATUS_LDAP(LDAP_OPERATIONS_ERROR); } diff --git a/source4/libcli/nbt/nbtsocket.c b/source4/libcli/nbt/nbtsocket.c index 597dc5a354..bb3e15d5de 100644 --- a/source4/libcli/nbt/nbtsocket.c +++ b/source4/libcli/nbt/nbtsocket.c @@ -214,7 +214,8 @@ static void nbt_name_socket_recv(struct nbt_name_socket *nbtsock) } /* find the matching request */ - req = idr_find(nbtsock->idr, packet->name_trn_id); + req = (struct nbt_name_request *)idr_find(nbtsock->idr, + packet->name_trn_id); if (req == NULL) { if (nbtsock->unexpected.handler) { nbtsock->unexpected.handler(nbtsock, packet, src); diff --git a/source4/libcli/resolve/resolve.c b/source4/libcli/resolve/resolve.c index 4df4de020c..63598fdd00 100644 --- a/source4/libcli/resolve/resolve.c +++ b/source4/libcli/resolve/resolve.c @@ -67,7 +67,7 @@ static const struct resolve_method *find_method(const char *name) */ static void resolve_handler(struct composite_context *creq) { - struct composite_context *c = creq->async.private_data; + struct composite_context *c = (struct composite_context *)creq->async.private_data; struct resolve_state *state = talloc_get_type(c->private_data, struct resolve_state); const struct resolve_method *method = find_method(state->methods[0]); diff --git a/source4/libcli/security/dom_sid.c b/source4/libcli/security/dom_sid.c index 64e418677a..8d6bb79714 100644 --- a/source4/libcli/security/dom_sid.c +++ b/source4/libcli/security/dom_sid.c @@ -278,7 +278,7 @@ char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid) } maxlen = sid->num_auths * 11 + 25; - ret = talloc_size(mem_ctx, maxlen); + ret = talloc_array(mem_ctx, char, maxlen); if (!ret) return talloc_strdup(mem_ctx, "(SID ERR)"); ia = (sid->id_auth[5]) + diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c index 392fec1cb9..545f3c8353 100644 --- a/source4/libcli/smb2/request.c +++ b/source4/libcli/smb2/request.c @@ -67,7 +67,7 @@ struct smb2_request *smb2_request_init(struct smb2_transport *transport, uint16_ req->out.size = SMB2_HDR_BODY+NBT_HDR_SIZE+body_fixed_size; req->out.allocated = req->out.size + body_dynamic_size; - req->out.buffer = talloc_size(req, req->out.allocated); + req->out.buffer = talloc_array(req, uint8_t, req->out.allocated); if (req->out.buffer == NULL) { talloc_free(req); return NULL; diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c index e7a2e163aa..8bd091a319 100644 --- a/source4/libcli/util/asn1.c +++ b/source4/libcli/util/asn1.c @@ -600,7 +600,7 @@ BOOL asn1_read_LDAPString(struct asn1_data *data, TALLOC_CTX *mem_ctx, char **s) data->has_error = True; return False; } - *s = talloc_size(mem_ctx, len+1); + *s = talloc_array(mem_ctx, char, len+1); if (! *s) { data->has_error = True; return False; |