Browse Source

do not add pointer increments on a void*, use uint8_t*

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Steve Lhomme 9 years ago
parent
commit
eca66fc08d
3 changed files with 4 additions and 4 deletions
  1. 1 1
      src/hmac_md5.c
  2. 2 2
      src/netbios_session.c
  3. 1 1
      src/smb_ntlm.c

+ 1 - 1
src/hmac_md5.c

@@ -42,7 +42,7 @@ unsigned char *HMAC_MD5(const void *key, size_t key_len, const void *msg,
     static uint8_t  hmac_static[16];
 
     uint8_t         key_pad[64], o_key_pad[64], i_key_pad[64], kcat[80];
-    void            *cat, *out;
+    uint8_t         *cat, *out;
     MD5_CTX         ctx;
 
     assert(key != NULL && msg != NULL);

+ 2 - 2
src/netbios_session.c

@@ -236,7 +236,7 @@ static ssize_t    netbios_session_get_next_packet(netbios_session *s)
     sofar = 0;
     while (sofar < total)
     {
-        res = recv(s->socket, (void *)(s->packet) + sofar, total - sofar, 0);
+        res = recv(s->socket, (uint8_t *)(s->packet) + sofar, total - sofar, 0);
         if (res <= 0)
         {
             BDSM_perror("netbios_session_packet_recv: ");
@@ -257,7 +257,7 @@ static ssize_t    netbios_session_get_next_packet(netbios_session *s)
 
     while (sofar < total)
     {
-        res = recv(s->socket, (void *)(s->packet) + sizeof(netbios_session_packet)
+        res = recv(s->socket, (uint8_t *)(s->packet) + sizeof(netbios_session_packet)
                    + sofar, total - sofar, 0);
         //BDSM_dbg("Total = %ld, sofar = %ld, res = %ld\n", total, sofar, res);
 

+ 1 - 1
src/smb_ntlm.c

@@ -157,7 +157,7 @@ uint8_t     *smb_ntlm2_response(smb_ntlmh hash_v2, uint64_t srv_challenge,
     if (smb_buffer_alloc(&data, sizeof(uint64_t) + blob->size) == 0)
         return NULL;
     memcpy(data.data, (void *)&srv_challenge, sizeof(uint64_t));
-    memcpy(data.data + sizeof(uint64_t), blob->data, blob->size);
+    memcpy((uint8_t*)data.data + sizeof(uint64_t), blob->data, blob->size);
 
     HMAC_MD5(hash_v2, SMB_NTLM_HASH_SIZE, data.data, data.size, &hmac);
     smb_buffer_free(&data);