Skip to content

Commit

Permalink
smb.c: Fixed code analysis warning
Browse files Browse the repository at this point in the history
smb.c:320: warning C6297: Arithmetic overflow: 32-bit value is shifted,
           then cast to 64-bit value. Result may not be an expected
           value
  • Loading branch information
captain-caveman2k committed Dec 14, 2014
1 parent 7fc1cbb commit 9166958
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/smb.c
Expand Up @@ -317,7 +317,7 @@ static CURLcode smb_recv_message(struct connectdata *conn, void **msg)
if(nbt_size >= msg_size + sizeof(unsigned short)) {
/* Add the byte count */
msg_size += sizeof(unsigned short) + ((unsigned char) buf[msg_size]) +
(((unsigned char) buf[msg_size + 1]) << 8);
(((size_t) ((unsigned char) buf[msg_size + 1])) << 8);
if(nbt_size < msg_size)
return CURLE_READ_ERROR;
}
Expand Down

0 comments on commit 9166958

Please sign in to comment.