Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong error checking for pread / pwrite calls [CORE6198] #6443

Open
firebird-automations opened this issue Nov 26, 2019 · 0 comments
Open

Wrong error checking for pread / pwrite calls [CORE6198] #6443

firebird-automations opened this issue Nov 26, 2019 · 0 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @dmitry-starodubov

pread and pwrite returns 64bit values (when 64 IO used, of course). Returning values are checked for errors like this
FB_UINT64 bytes;
...
if ((bytes = pread(file->fil_desc, page, size, LSEEK_OFFSET_CAST offset)) == size)
break;
if (bytes == -1U && !SYSCALL_INTERRUPTED(errno))
return unix_error("read", file, isc_io_read_err, status_vector);
But -1U is 4294967295 and function returns -1UL (18446744073709551615) so check doesn't work.

Commits: ba516f6 78510ed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant