From 5f0d8eb9ccc98eea496788cb07bb494b133c668e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Cla=C3=9Fen?= Date: Thu, 27 Jun 2024 16:15:27 +0200 Subject: [PATCH] Fixed an overflow when files were listed that are above 2G --- src/awscr-s3/object.cr | 2 +- src/awscr-s3/responses/list_objects_v2.cr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/awscr-s3/object.cr b/src/awscr-s3/object.cr index 947a27e..90837ab 100644 --- a/src/awscr-s3/object.cr +++ b/src/awscr-s3/object.cr @@ -13,7 +13,7 @@ module Awscr::S3 # The time string the `Object` was last modifed getter last_modified - def initialize(@key : String, @size : Int32, @etag : String, @last_modified : Time) + def initialize(@key : String, @size : Int64, @etag : String, @last_modified : Time) end def_equals @key, @size, @etag, @last_modified diff --git a/src/awscr-s3/responses/list_objects_v2.cr b/src/awscr-s3/responses/list_objects_v2.cr index ebee6c8..1422397 100644 --- a/src/awscr-s3/responses/list_objects_v2.cr +++ b/src/awscr-s3/responses/list_objects_v2.cr @@ -21,7 +21,7 @@ module Awscr::S3::Response objects = [] of Object xml.array("ListBucketResult/Contents") do |object| key = object.string("Key") - size = object.string("Size").to_i + size = object.string("Size").to_i64 etag = object.string("ETag") last_modified = Time.parse(object.string("LastModified"), DATE_FORMAT, Time::Location::UTC)