Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jun 2018 09:06:53 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335126 - head/stand/libsa
Message-ID:  <201806140906.w5E96rA4041125@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806140906.w5E96rA4041125>