Chapter 7 File I/O

with David Riley1

1. David Riley is a Professor of Computer Science at the University of Wisconsin-LaCrosse.

But, when I came,—some minute ere the timeOf her awakening,—here untimely layThe noble Paris and true Romeo, dead.

—William Shakespeare, Romeo and Juliet, Act V, Scene 3

C and C++ programs commonly read and write to files as part of their normal operations. Numerous vulnerabilities have resulted from irregularities in how these programs interact with the file system—the operation of which is defined by the underlying operating system. Many of these irregularities are caused by race conditions—a consequence of the use of concurrency in modern computer systems. As a result, this chapter begins with a brief discussion ...

Get Secure Coding in C and C++ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.