From 7416e819ad3cc6fac1c547e9e587d4226a81ee96 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 14 Jun 2018 09:06:53 +0000 Subject: [PATCH] libsa: f_rabuf could be NULL It is possible that we will not get RA buffer from open(), therefore we must validate RA. --- stand/libsa/read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/read.c b/stand/libsa/read.c index 5a96e2b35642..021425371ee7 100644 --- a/stand/libsa/read.c +++ b/stand/libsa/read.c @@ -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