]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:registry: Use correct integer sizes
authorAndreas Schneider <asn@samba.org>
Wed, 26 Jun 2024 12:32:41 +0000 (14:32 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 8 Jul 2024 07:36:32 +0000 (07:36 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/registry/regfio.c

index 3756c8cdb1300aebab715434e427e33775888f86..2ddac2179b24cef4f68452e391f5e8a8b34bbda7 100644 (file)
@@ -115,7 +115,7 @@ static int write_block( REGF_FILE *file, prs_struct *ps, uint32_t offset )
 
 static int read_block( REGF_FILE *file, prs_struct *ps, uint32_t file_offset, uint32_t block_size )
 {
-       int bytes_read, returned;
+       ssize_t bytes_read, returned;
        char *buffer;
        SMB_STRUCT_STAT sbuf;
 
@@ -182,7 +182,7 @@ static int read_block( REGF_FILE *file, prs_struct *ps, uint32_t file_offset, ui
                        return False;
                }
 
-               if (returned < 0 || bytes_read > INT_MAX - returned) {
+               if (returned < 0 || bytes_read > SSIZE_MAX - returned) {
                        DBG_ERR("Integer overflow\n");
                        return false;
                }