Lines Matching refs:of

3 xnu implements most POSIX C string functions, including the inherited subset of
5 of these functions, including the more modern `strl` functions, confusing or
6 unsafe. In addition, the advent of -fbounds-safety support in xnu is forcing
8 failings of POSIX C string functions, xnu's `strbuf` functions, and their
14 * use `strl*` when you have the length of _one_ string, and the other is
16 * use `str*` when you don't have the length for any of the strings, and they
23 result. Given `strcmp(first, secnd, n)`, you need to know the types of `first`
37 > passing 'const char *__indexable' to parameter of incompatible type
52 because they don't care about the bounds of the output buffer. Most or all of
57 is no danger of writing out of bounds (out of not writing at all).
71 terminated string. Because of coexistence with `strn` functions that make no
81 `strlcpy` returns the length of the input string; in xnu's implementation,
84 is always a problem from the perspective of memory disclosures, and in some
96 * When -fbounds-safety flags that the use of a string function was improper,
99 The most common use of character buffers is to build a string, and then this
113 * `strl` (new) functions, accepting _one_ character buffer of a known size and
119 in lieu of a pointer+length pair: `strbuflen(array)`, `strbufcmp(a, b)`,
122 If the destination array of `strbufcpy` or `strbufcat` has a size of 0, they
127 of indexable pointer, and only once you're done should you convert it to a
136 // lots of __unsafe!
148 while it's being modified leads to more forging, which has more chances of
160 This example has two views of the same data: `my_buffer` (through which the
168 a character array such that you get a NUL-terminated view of it. For instance,
196 `__unsafe_null_terminated_from_indexable` at the end of the sequence to get your
204 be in bounds of the result pointer) or `__unsafe_null_terminated_to_indexable`
206 buffers that have lengths and some of them happen to also be NUL-terminated
208 flavor of indexable pointers instead of having conversions from and to
233 of -fbounds-safety to guide you to the best choice, as a rule of thumb, you
240 That is, to implement `bar`, you have a choice of `strcmp`, `strncmp` and
247 you know the length of each string, of just one, or of neither).