Invalid file position
fsetpos() is invoked with a file position argument not obtained
from fgetpos()
Description
This defect occurs when the file position argument
of fsetpos() uses a value that is not obtained from
fgetpos().
Risk
The function fgetpos(FILE *stream, fpos_t *pos) gets the current file
position of the stream. When you use any other value as the file position argument of
fsetpos(FILE *stream, const fpos_t *pos), you might access an
unintended location in the stream.
Fix
Use the value returned from a successful call to fgetpos() as the
file position argument of fsetpos().
Examples
Result Information
| Group: Programming |
| Language: C | C++ |
| Default: Off |
Command-Line Syntax:
INVALID_FILE_POS
|
| Impact: Medium |
Version History
Introduced in R2017b
See Also
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)