mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r22747: Fix some C++ warnings
This commit is contained in:
parent
a99ab3a2ed
commit
a66a04e9f1
@ -213,13 +213,16 @@ static void ndr_print_string_helper(struct ndr_print *ndr, const char *format, .
|
||||
int i;
|
||||
|
||||
for (i=0;i<ndr->depth;i++) {
|
||||
ndr->private_data = talloc_asprintf_append(ndr->private_data, " ");
|
||||
ndr->private_data = talloc_asprintf_append(
|
||||
(char *)ndr->private_data, " ");
|
||||
}
|
||||
|
||||
va_start(ap, format);
|
||||
ndr->private_data = talloc_vasprintf_append(ndr->private_data, format, ap);
|
||||
ndr->private_data = talloc_vasprintf_append(
|
||||
(char *)ndr->private_data, format, ap);
|
||||
va_end(ap);
|
||||
ndr->private_data = talloc_asprintf_append(ndr->private_data, "\n");
|
||||
ndr->private_data = talloc_asprintf_append(
|
||||
(char *)ndr->private_data, "\n");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1450,7 +1450,7 @@ done:
|
||||
|
||||
*opt = NULL;
|
||||
|
||||
if ((my_opt = SMB_MALLOC(sizeof(krb5_get_init_creds_opt))) == NULL) {
|
||||
if ((my_opt = SMB_MALLOC_P(krb5_get_init_creds_opt)) == NULL) {
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ NTSTATUS common_ntlm_decrypt_buffer(NTLMSSP_STATE *ntlmssp_state, char *buf)
|
||||
return NT_STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
inbuf = smb_xmemdup(buf, buf_len);
|
||||
inbuf = (char *)smb_xmemdup(buf, buf_len);
|
||||
|
||||
/* Adjust for the signature. */
|
||||
data_len = buf_len - 8 - NTLMSSP_SIG_SIZE;
|
||||
@ -204,7 +204,7 @@ static NTSTATUS common_gss_decrypt_buffer(struct smb_tran_enc_state_gss *gss_sta
|
||||
}
|
||||
|
||||
memcpy(buf + 8, out_buf.value, out_buf.length);
|
||||
smb_setlen(out_buf.value, buf, out_buf.length + 4);
|
||||
smb_setlen((char *)out_buf.value, buf, out_buf.length + 4);
|
||||
|
||||
gss_release_buffer(&minor, &out_buf);
|
||||
return NT_STATUS_OK;
|
||||
@ -269,7 +269,7 @@ static NTSTATUS common_gss_encrypt_buffer(struct smb_tran_enc_state_gss *gss_sta
|
||||
* bother :-*(. JRA.
|
||||
*/
|
||||
|
||||
*ppbuf_out = SMB_MALLOC(out_buf.length + 8); /* We know this can't wrap. */
|
||||
*ppbuf_out = (char *)SMB_MALLOC(out_buf.length + 8); /* We know this can't wrap. */
|
||||
if (!*ppbuf_out) {
|
||||
gss_release_buffer(&minor, &out_buf);
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
@ -2318,7 +2318,7 @@ void cache_store_response(pid_t pid, struct winbindd_response *response)
|
||||
|
||||
fstr_sprintf(key_str, "DE/%d", pid);
|
||||
if (tdb_store(wcache->tdb, string_tdb_data(key_str),
|
||||
make_tdb_data(response->extra_data.data,
|
||||
make_tdb_data((uint8 *)response->extra_data.data,
|
||||
response->length - sizeof(*response)),
|
||||
TDB_REPLACE) == 0)
|
||||
return;
|
||||
@ -3193,7 +3193,7 @@ static int cache_traverse_validate_fn(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_D
|
||||
char *keystr;
|
||||
int ret;
|
||||
|
||||
keystr = SMB_MALLOC(kbuf.dsize+1);
|
||||
keystr = SMB_MALLOC_ARRAY(char, kbuf.dsize+1);
|
||||
if (!keystr) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -1357,7 +1357,7 @@ static void print_queue_receive(int msg_type, struct server_id src,
|
||||
int printing_type;
|
||||
size_t len;
|
||||
|
||||
len = tdb_unpack( buf, msglen, "fdPP",
|
||||
len = tdb_unpack( (uint8 *)buf, msglen, "fdPP",
|
||||
sharename,
|
||||
&printing_type,
|
||||
lpqcommand,
|
||||
|
@ -492,8 +492,7 @@ static NTSTATUS srv_enc_spnego_negotiate(connection_struct *conn,
|
||||
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
/* Return the context we're using for this encryption state. */
|
||||
*pparam = SMB_MALLOC(2);
|
||||
if (!*pparam) {
|
||||
if (!(*pparam = SMB_MALLOC_ARRAY(unsigned char, 2))) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
SSVAL(*pparam,0,partial_srv_trans_enc_ctx->es->enc_ctx_num);
|
||||
@ -542,8 +541,7 @@ static NTSTATUS srv_enc_spnego_ntlm_auth(connection_struct *conn,
|
||||
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
/* Return the context we're using for this encryption state. */
|
||||
*pparam = SMB_MALLOC(2);
|
||||
if (!*pparam) {
|
||||
if (!(*pparam = SMB_MALLOC_ARRAY(unsigned char, 2))) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
SSVAL(*pparam,0,ec->es->enc_ctx_num);
|
||||
@ -593,8 +591,7 @@ static NTSTATUS srv_enc_raw_ntlm_auth(connection_struct *conn,
|
||||
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
/* Return the context we're using for this encryption state. */
|
||||
*pparam = SMB_MALLOC(2);
|
||||
if (!*pparam) {
|
||||
if (!(*pparam = SMB_MALLOC_ARRAY(unsigned char, 2))) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
SSVAL(*pparam,0,ec->es->enc_ctx_num);
|
||||
|
@ -990,8 +990,7 @@ static NTSTATUS check_spnego_blob_complete(uint16 smbpid, uint16 vuid, DATA_BLOB
|
||||
}
|
||||
|
||||
/* We must store this blob until complete. */
|
||||
pad = SMB_MALLOC(sizeof(struct pending_auth_data));
|
||||
if (!pad) {
|
||||
if (!(pad = SMB_MALLOC_P(struct pending_auth_data))) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
pad->needed_len = needed_len - pblob->length;
|
||||
|
@ -263,7 +263,7 @@ static NTSTATUS registry_enumvalues(TALLOC_CTX *ctx,
|
||||
name_buf.size = max_valnamelen + 2;
|
||||
|
||||
data_size = max_valbufsize;
|
||||
data = TALLOC(mem_ctx, data_size);
|
||||
data = (uint8 *)TALLOC(mem_ctx, data_size);
|
||||
value_length = 0;
|
||||
|
||||
status = rpccli_winreg_EnumValue(pipe_hnd, mem_ctx, key_hnd,
|
||||
|
Loading…
Reference in New Issue
Block a user