You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4735 Reporter: gildor Status: closed (set by @xavierleroy on 2009-03-28T16:40:12Z) Resolution: fixed Priority: normal Severity: major Version: 3.10.2 Fixed in version: 3.11.1+dev Category: ~DO NOT USE (was: OCaml general)
Bug description
In file otherlibs/win32unix/stat.c
CAMLprim value unix_fstat_64(value handle)
{
int ret;
struct _stati64 buf;
ret = _fstati64(win_CRT_fd_of_filedescr(handle), &buf);
if (ret == -1) uerror("fstat", Nothing);
if (buf.st_size > Max_long) {
win32_maperr(ERROR_ARITHMETIC_OVERFLOW);
uerror("fstat", Nothing);
}
return stat_aux(1, &buf);
}
The test with Max_long is a copy an paste from unix_fstat. It should be rewritten as is:
CAMLprim value unix_fstat_64(value handle)
{
int ret;
struct _stati64 buf;
ret = _fstati64(win_CRT_fd_of_filedescr(handle), &buf);
if (ret == -1) uerror("fstat", Nothing);
return stat_aux(1, &buf);
}
This allow to report size over 31 bits long.
The text was updated successfully, but these errors were encountered:
Original bug ID: 4735
Reporter: gildor
Status: closed (set by @xavierleroy on 2009-03-28T16:40:12Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.10.2
Fixed in version: 3.11.1+dev
Category: ~DO NOT USE (was: OCaml general)
Bug description
In file otherlibs/win32unix/stat.c
CAMLprim value unix_fstat_64(value handle)
{
int ret;
struct _stati64 buf;
ret = _fstati64(win_CRT_fd_of_filedescr(handle), &buf);
if (ret == -1) uerror("fstat", Nothing);
if (buf.st_size > Max_long) {
win32_maperr(ERROR_ARITHMETIC_OVERFLOW);
uerror("fstat", Nothing);
}
return stat_aux(1, &buf);
}
The test with Max_long is a copy an paste from unix_fstat. It should be rewritten as is:
CAMLprim value unix_fstat_64(value handle)
{
int ret;
struct _stati64 buf;
ret = _fstati64(win_CRT_fd_of_filedescr(handle), &buf);
if (ret == -1) uerror("fstat", Nothing);
return stat_aux(1, &buf);
}
This allow to report size over 31 bits long.
The text was updated successfully, but these errors were encountered: