Author: tsoome
Date: Thu Jun 14 09:06:53 2018
New Revision: 335126
URL: https://svnweb.freebsd.org/changeset/base/335126

Log:
  libsa: f_rabuf could be NULL
  
  It is possible that we will not get RA buffer from open(), therefore
  we must validate RA.

Modified:
  head/stand/libsa/read.c

Modified: head/stand/libsa/read.c
==============================================================================
--- head/stand/libsa/read.c     Thu Jun 14 08:58:10 2018        (r335125)
+++ head/stand/libsa/read.c     Thu Jun 14 09:06:53 2018        (r335126)
@@ -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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to