]> granicus.if.org Git - curl/commitdiff
ntlm: Use short integer when decoding 16-bit values
authorSteve Holme <steve_holme@hotmail.com>
Sat, 13 Dec 2014 11:14:55 +0000 (11:14 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Sat, 13 Dec 2014 11:18:00 +0000 (11:18 +0000)
lib/curl_ntlm_msgs.c

index 69e17899255bca899bc49b0087b431a489b6ec1f..26f20409c1bd6d2ff0ed9826119e6261f59fcbb0 100644 (file)
@@ -164,9 +164,9 @@ static unsigned int readint_le(unsigned char *buf)
  * package to whatever endian format we're using natively. Argument is a
  * pointer to a 2 byte buffer.
  */
-static unsigned int readshort_le(unsigned char *buf)
+static unsigned short readshort_le(unsigned char *buf)
 {
-  return ((unsigned int)buf[0]) | ((unsigned int)buf[1] << 8);
+  return ((unsigned short)buf[0]) | ((unsigned short)buf[1] << 8);
 }
 
 /*
@@ -189,7 +189,7 @@ static CURLcode ntlm_decode_type2_target(struct SessionHandle *data,
                                          size_t size,
                                          struct ntlmdata *ntlm)
 {
-  unsigned int target_info_len = 0;
+  unsigned short target_info_len = 0;
   unsigned int target_info_offset = 0;
 
   if(size >= 48) {