Skip to content

Commit fa5ef84

Browse files
author
Boquan Fang
committed
doc: add definitions for tainted
1 parent 3f9f20a commit fa5ef84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/DEVELOPMENT-GUIDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ The `high_water_mark` tracks the furthermost byte which has been written but not
347347
Note that this may be past the `write_cursor` if `s2n_stuffer_rewrite()` has been called.
348348
Explicitly tracking the `high_water_mark` allows us to track the bytes which need to be wiped, and helps avoids needless zeroing of memory.
349349
The next two bits of state track whether a stuffer was dynamically allocated (and so should be free'd later) and whether or not it is growable.
350-
`tainted` is set to 1 whenever the raw access functions are called.
350+
`tainted` is set to true whenever the raw access functions are called.
351+
Raw access functions return an outstanding pointer that references the beginning of a memory chunk within the stuffer. Whenever such an outstanding pointer is accessible, the stuffer's `tainted` flag must be set to true. However, if the outstanding pointer is no longer accessable, the stuffer's `tainted` flag can be set to false.
351352
If a stuffer is currently tainted then it can not be resized and it becomes ungrowable.
352353
This is reset when a stuffer is explicitly wiped, which begins the life-cycle anew.
353354
So any pointers returned by the raw access functions are legal only until `s2n_stuffer_wipe()` is called.

0 commit comments

Comments
 (0)