@@ -93,9 +93,8 @@ The TR24731 specification says an implementation may set errno for the
93
93
functions defined in the technical report, but is not required to.
94
94
This library does not set `errno` in most functions, only in
95
95
bsearch_s, fscanf_s, fwscanf_s, gets_s, gmtime_s, localtime_s,
96
- scanf_s, sprintf_s, sscanf_s, swprintf_s, swscanf_s, strtok_s, vfscanf_s,
97
- vfwscanf_s, vsscanf_s vsprintf_s, vswprintf_s, vswscanf_s, wcstok_s,
98
- wscanf_s.
96
+ scanf_s, sscanf_s, swscanf_s, strtok_s, vfscanf_s,
97
+ vfwscanf_s, vsscanf_s, vswscanf_s, wcstok_s, wscanf_s.
99
98
100
99
In most cases the safeclib extended ES* errors do not set errno, only
101
100
when the underlying insecure system call fails, errno is set. The
@@ -113,11 +112,14 @@ Per the spec, multiple runtime-constraint violations in the same call to a
113
112
library function result in only one call to the runtime-constraint handler.
114
113
The first violation encountered invokes the runtime-constraint handler.
115
114
115
+ With `--disable-constraint-handler` calling the runtime-constraint handler
116
+ can be disabled, saving some memory, but not much run-time performance.
117
+
116
118
The runtime-constraint handler might not return. If the handler does
117
119
return, the library function whose runtime-constraint was violated
118
120
returns an indication of failure as given by the function’s return.
119
121
With valid dest and dmax values, dest is cleared. With the optional
120
- --disable-null-slack only the first value of dest is cleared,
122
+ ` --disable-null-slack` only the first value of dest is cleared,
121
123
otherwise the whole dest buffer.
122
124
123
125
rsize_t::
@@ -141,9 +143,9 @@ are performed at compile-time. Currently only since clang-5 with
141
143
`diagnose_if` support. This checks similar to `_FORTIFY_SOURCE=2` if
142
144
the `__builtin_object_size` of the dest buffer is the same size as
143
145
dmax, and errors if dmax is too big. With the optional
144
- --enable-warn-dmax it prints a warning if the sizes are different,
146
+ ` --enable-warn-dmax` it prints a warning if the sizes are different,
145
147
which is esp. practical as compile-time warning. It can be promoted
146
- via the optional --enable-error-dmax to be fatal. On unsupported
148
+ via the optional ` --enable-error-dmax` to be fatal. On unsupported
147
149
compilers, the overflow check and optional equality warn-dmax check is
148
150
deferred to run-time. This check is only possible with
149
151
`__builtin_object_size` and `-O2` when the dest buffer size is known
@@ -152,11 +154,14 @@ at compile-time, otherwise only the simplier `dest == NULL`, `dmax ==
152
154
153
155
* Header Files
154
156
155
- The specification states the various functions would be added to existing
156
- Standard C header files: stdio.h, string.h, etc. This implementation
157
- separates the memory related functions into the `safe_mem_lib.h` header, the
158
- string related functions into the `safe_str_lib.h` header, and the rest into
159
- the `safe_lib.h` header.
157
+ The specification states the various functions would be added to
158
+ existing Standard C header files: stdio.h, string.h, etc. This
159
+ implementation separates the memory related functions into the
160
+ `safe_mem_lib.h` header, the string related functions into the
161
+ `safe_str_lib.h` header, and the rest into the `safe_lib.h`
162
+ header. There are also the internal `safe_compile.h`, `safe_config.h`
163
+ `safe_lib_errno.h` and `safe_types.h` headers, but they do not need to
164
+ be included.
160
165
161
166
The make file builds a single library `libsafec-VERSION.a` and `.so` in the
162
167
`src/.libs` directory.
@@ -256,7 +261,7 @@ with most available compilers. See `build-tools/smoke.sh`.
256
261
Known Issues
257
262
------------
258
263
1. If you are building the library from the git repository you will have to
259
- first run build-tools/autogen.sh which runs autoreconf to ``install'' the
264
+ first run ` build-tools/autogen.sh` which runs autoreconf to ``install'' the
260
265
autotools files and create the configure script.
261
266
262
267
[bibliography]
0 commit comments