Lines Matching refs:strscpy
47 strscpy(src, "over ten bytes", size);
112 strscpy(src, "over ten bytes", size);
134 * Calls fortified strscpy to test that it returns the same result as vanilla
135 * strscpy and generate a panic because there is a write overflow (i.e. src
156 /* Vanilla strscpy returns -E2BIG if size is 0. */
157 if (strscpy(dst, src, 0) != -E2BIG)
158 pr_warn("FAIL: strscpy() of 0 length did not return -E2BIG\n");
160 /* Vanilla strscpy returns -E2BIG if src is truncated. */
161 if (strscpy(dst, src, sizeof(dst)) != -E2BIG)
162 pr_warn("FAIL: strscpy() did not return -E2BIG while src is truncated\n");
166 pr_warn("FAIL: after strscpy() dst does not contain \"foob\" but \"%s\"\n",
169 /* Shrink src so the strscpy() below succeeds. */
173 * Vanilla strscpy returns number of character copied if everything goes
176 if (strscpy(dst, src, sizeof(dst)) != 3)
177 pr_warn("FAIL: strscpy() did not return 3 while src was copied entirely truncated\n");
181 pr_warn("FAIL: after strscpy() dst does not contain \"foo\" but \"%s\"\n",
185 strscpy(weird_dst, weird.src, sizeof(weird_dst));
188 pr_warn("FAIL: after strscpy() weird_dst does not contain \"hello\" but \"%s\"\n",
198 strscpy(dst, src, strlen(src));
200 pr_err("FAIL: strscpy() overflow not detected!\n");