mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Disallow fseek() optimization in internal read buffer, if pointer is moved by
seek. It means that beginning of read buffer becomes not the same as current file position.
This commit is contained in:
parent
9965784733
commit
751fc77994
1 changed files with 5 additions and 0 deletions
|
|
@ -164,6 +164,11 @@ _sseek(fp, offset, whence)
|
|||
errret = errno;
|
||||
if (errno == 0)
|
||||
errno = serrno;
|
||||
|
||||
if (errret == 0 && (offset != 0 || whence != SEEK_CUR))
|
||||
/* Disallow fseek() optimization inside read buffer */
|
||||
fp->_flags |= __SMOD;
|
||||
|
||||
/*
|
||||
* Disallow negative seeks per POSIX.
|
||||
* It is needed here to help upper level caller
|
||||
|
|
|
|||
Loading…
Reference in a new issue