s3:libsmb: Fix size types in nmblib
authorAndreas Schneider <asn@samba.org>
Thu, 7 Dec 2017 16:52:39 +0000 (17:52 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 20 Mar 2018 22:16:15 +0000 (23:16 +0100)
This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/libsmb/nmblib.c

index 5bfc129ebf53a8099c3f3cc91167a503713053ec..ef6177e52096830066d7d3ea52e9539aa19b6d6e 100644 (file)
@@ -176,11 +176,11 @@ static bool handle_name_ptrs(unsigned char *ubuf,int *offset,int length,
 
 static int parse_nmb_name(char *inbuf,int ofs,int length, struct nmb_name *name)
 {
-       int m,n=0;
+       size_t m,n=0;
        unsigned char *ubuf = (unsigned char *)inbuf;
        int ret = 0;
        bool got_pointer=False;
-       int loop_count=0;
+       size_t loop_count=0;
        int offset = ofs;
 
        if (length - offset < 2)
@@ -483,7 +483,7 @@ static int put_compressed_name_ptr(unsigned char *buf,
 
 static bool parse_dgram(char *inbuf,int length,struct dgram_packet *dgram)
 {
-       int offset;
+       size_t offset;
        int flags;
 
        memset((char *)dgram,'\0',sizeof(*dgram));