summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-07-12 08:23:24 -0400
committerSimo Sorce <simo@redhat.com>2014-07-12 08:23:24 -0400
commit43e49676f7bdf88aa9e935d91c6c4b8dd5ac5b9a (patch)
tree2b5b5a7be6a3320d0ba39c385f0897ebcfa314b6
parent3ed1be459d9cec2d07a06e3960f26815ce22b5a3 (diff)
downloadgss-ntlmssp-43e49676f7bdf88aa9e935d91c6c4b8dd5ac5b9a.tar.gz
gss-ntlmssp-43e49676f7bdf88aa9e935d91c6c4b8dd5ac5b9a.tar.xz
gss-ntlmssp-43e49676f7bdf88aa9e935d91c6c4b8dd5ac5b9a.zip
Cast to (char *) not (void *) to do pointer math
-rw-r--r--src/gss_serialize.c8
-rw-r--r--src/ntlm.c12
2 files changed, 10 insertions, 10 deletions
diff --git a/src/gss_serialize.c b/src/gss_serialize.c
index 6b137ce..ef35dd4 100644
--- a/src/gss_serialize.c
+++ b/src/gss_serialize.c
@@ -273,7 +273,7 @@ uint32_t gssntlm_export_sec_context(uint32_t *minor_status,
return GSS_S_FAILURE;
}
ectx = (struct export_ctx *)state.exp_struct;
- state.exp_data = (void *)ectx->data - (void *)ectx;
+ state.exp_data = (char *)ectx->data - (char *)ectx;
state.exp_len = state.exp_data;
state.exp_ptr = 0;
@@ -592,7 +592,7 @@ uint32_t gssntlm_import_sec_context(uint32_t *minor_status,
state.exp_struct = interprocess_token->value;
state.exp_len = interprocess_token->length;
ectx = (struct export_ctx *)state.exp_struct;
- state.exp_data = (void *)ectx->data - (void *)ectx;
+ state.exp_data = (char *)ectx->data - (char *)ectx;
state.exp_ptr = 0;
if (ectx->version != le16toh(1)) {
@@ -769,7 +769,7 @@ uint32_t gssntlm_export_cred(uint32_t *minor_status,
return GSS_S_FAILURE;
}
ecred = (struct export_cred *)state.exp_struct;
- state.exp_data = (void *)ecred->data - (void *)ecred;
+ state.exp_data = (char *)ecred->data - (char *)ecred;
state.exp_len = state.exp_data;
state.exp_ptr = 0;
@@ -857,7 +857,7 @@ uint32_t gssntlm_import_cred(uint32_t *minor_status,
state.exp_struct = token->value;
state.exp_len = token->length;
ecred = (struct export_cred *)state.exp_struct;
- state.exp_data = (void *)ecred->data - (void *)ecred;
+ state.exp_data = (char *)ecred->data - (char *)ecred;
state.exp_ptr = 0;
if (ecred->version != le16toh(1)) {
diff --git a/src/ntlm.c b/src/ntlm.c
index 7509351..969e684 100644
--- a/src/ntlm.c
+++ b/src/ntlm.c
@@ -957,7 +957,7 @@ int ntlm_encode_neg_msg(struct ntlm_ctx *ctx, uint32_t flags,
if (!buffer.data) return ENOMEM;
msg = (struct wire_neg_msg *)buffer.data;
- data_offs = (void *)msg->payload - (void *)msg;
+ data_offs = (char *)msg->payload - (char *)msg;
ntlm_encode_header(&msg->header, NEGOTIATE_MESSAGE);
@@ -998,7 +998,7 @@ int ntlm_decode_neg_msg(struct ntlm_ctx *ctx,
if (!ctx) return EINVAL;
msg = (struct wire_neg_msg *)buffer->data;
- payload_offs = (void *)msg->payload - (void *)msg;
+ payload_offs = (char *)msg->payload - (char *)msg;
neg_flags = le32toh(msg->neg_flags);
@@ -1071,7 +1071,7 @@ int ntlm_encode_chal_msg(struct ntlm_ctx *ctx,
if (!buffer.data) return ENOMEM;
msg = (struct wire_chal_msg *)buffer.data;
- data_offs = (void *)msg->payload - (void *)msg;
+ data_offs = (char *)msg->payload - (char *)msg;
ntlm_encode_header(&msg->header, CHALLENGE_MESSAGE);
@@ -1128,7 +1128,7 @@ int ntlm_decode_chal_msg(struct ntlm_ctx *ctx,
if (challenge->length < 8) return EINVAL;
msg = (struct wire_chal_msg *)buffer->data;
- payload_offs = (void *)msg->payload - (void *)msg;
+ payload_offs = (char *)msg->payload - (char *)msg;
flags = le32toh(msg->neg_flags);
@@ -1234,7 +1234,7 @@ int ntlm_encode_auth_msg(struct ntlm_ctx *ctx,
if (!buffer.data) return ENOMEM;
msg = (struct wire_auth_msg *)buffer.data;
- data_offs = (void *)msg->payload - (void *)msg;
+ data_offs = (char *)msg->payload - (char *)msg;
ntlm_encode_header(&msg->header, AUTHENTICATE_MESSAGE);
@@ -1339,7 +1339,7 @@ int ntlm_decode_auth_msg(struct ntlm_ctx *ctx,
if (enc_sess_key) enc_sess_key->data = NULL;
msg = (struct wire_auth_msg *)buffer->data;
- payload_offs = (void *)msg->payload - (void *)msg;
+ payload_offs = (char *)msg->payload - (char *)msg;
/* this must be first as it pushes the payload further down */
if (flags & NTLMSSP_NEGOTIATE_VERSION) {