Re: [fossil-users] src/blob.c : blob_read_from_file overflow int size

2017-06-13 Thread Stephan Beal
On Tue, Jun 13, 2017 at 3:03 PM, Martin Gagnon wrote: > However, I think the best types for Blob structure is probably size_t. > I'm not sure if it's okay to use size_t with C89, but fossil already use > it in some places (even in blob.c), so I guess it's not a problem. >

Re: [fossil-users] src/blob.c : blob_read_from_file overflow int size

2017-06-13 Thread Martin Gagnon
On Tue, Jun 13, 2017 at 04:19:53PM +0900, kowlsd3pw...@yahoo.co.jp wrote: > > [837333fc] Fix the blob_read_from_file > thank you. Actually, it is not completely fix because blob_read_from_file() call blob_read_from_channel() which return a int. Anyway, since the internals of the Blob

Re: [fossil-users] src/blob.c : blob_read_from_file overflow int size

2017-06-13 Thread Stephan Beal
On Tue, Jun 13, 2017 at 9:10 AM, wrote: > Nobody will put big files, but there are logic defects > > int size; > > file size is INT_MAX + 1 then size is negative(INT_MIN) > Actually, that's not guaranteed. The C standard guarantees overflow/underflow behaviour only

Re: [fossil-users] src/blob.c : blob_read_from_file overflow int size

2017-06-13 Thread kowlsd3pw23s
[837333fc] Fix the blob_read_from_file thank you. ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Re: [fossil-users] src/blob.c : blob_read_from_file overflow int size

2017-06-13 Thread kowlsd3pw23s
Nobody will put big files, but there are logic defects int size; file size is  INT_MAX + 1 then size is negative(INT_MIN) file size is UINT_MAX + 2 then size is 1___ fossil-users mailing list fossil-users@lists.fossil-scm.org

[fossil-users] src/blob.c : blob_read_from_file overflow int size

2017-06-12 Thread kowlsd3pw23s
src/blob.c : blob_read_from_file https://www.fossil-scm.org/index.html/artifact?ln=795=141d4f5494ed6d1a 795    int size, 801    size = file_wd_size(zFilename); 803    if( size<0 ){ It will not function normally if the file size is larger than INT_MAX. file size is i64. file_wd_size return i64.