libsa: f_rabuf could be NULL

It is possible that we will not get RA buffer from open(), therefore
we must validate RA.
This commit is contained in:
Toomas Soome 2018-06-14 09:06:53 +00:00
parent f03b083204
commit 7416e819ad

View File

@ -108,7 +108,7 @@ read(int fd, void *dest, size_t bcount)
}
/* will filling the readahead buffer again not help? */
if (resid >= SOPEN_RASIZE) {
if (f->f_rabuf == NULL || resid >= SOPEN_RASIZE) {
/*
* bypass the rest of the request and leave the
* buffer empty