Changeset: a592c74f29be for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a592c74f29be
Modified Files:
        monetdb5/modules/mal/mal_io.c
Branch: Oct2020
Log Message:

Fixed size check.


diffs (35 lines):

diff --git a/monetdb5/modules/mal/mal_io.c b/monetdb5/modules/mal/mal_io.c
--- a/monetdb5/modules/mal/mal_io.c
+++ b/monetdb5/modules/mal/mal_io.c
@@ -670,26 +670,26 @@ IOimport(void *ret, bat *bid, str *fnme)
                        BBPunfix(b->batCacheid);
                        fclose(fp);
                        GDKfree(buf);
-                       throw(MAL, "io.import", OPERATION_FAILED " fileno()");
+                       throw(MAL, "io.import", OPERATION_FAILED ": fileno()");
                }
                if (fstat(fn, &st) != 0) {
                        BBPunfix(b->batCacheid);
                        fclose(fp);
                        GDKfree(buf);
-                       throw(MAL, "io.imports", OPERATION_FAILED "fstat()");
+                       throw(MAL, "io.imports", OPERATION_FAILED ": fstat()");
                }
 
                (void) fclose(fp);
                if (st.st_size <= 0) {
                        BBPunfix(b->batCacheid);
                        GDKfree(buf);
-                       throw(MAL, "io.imports", OPERATION_FAILED "Empty file");
+                       throw(MAL, "io.imports", OPERATION_FAILED ": empty 
file");
                }
 #if SIZEOF_SIZE_T == SIZEOF_INT
-               if (st.st_size > (off_t) ~ (size_t) 0) {
+               if (st.st_size > 0x7FFFFFFF) {
                        BBPunfix(b->batCacheid);
                        GDKfree(buf);
-                       throw(MAL, "io.imports", OPERATION_FAILED "File too 
large");
+                       throw(MAL, "io.imports", OPERATION_FAILED ": file too 
large");
                }
 #endif
                base = cur = (char *) GDKmmap(*fnme, MMAP_SEQUENTIAL, (size_t) 
st.st_size);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to