Loading system/osi/include/compat.h +0 −3 Original line number Diff line number Diff line Loading @@ -31,7 +31,4 @@ pid_t gettid(void) throw(); /* Copy src to string dst of size siz. */ size_t strlcpy(char* dst, const char* src, size_t siz); /* Appends src to string dst of size siz. */ size_t strlcat(char* dst, const char* src, size_t siz); #endif system/osi/src/compat.cc +0 −36 Original line number Diff line number Diff line Loading @@ -83,39 +83,3 @@ size_t strlcpy(char* dst, const char* src, size_t siz) { return (s - src - 1); /* count does not include NUL */ } #endif #if __GLIBC__ /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters * will be copied. Always NUL terminates (unless siz <= strlen(dst)). * Returns strlen(src) + MIN(siz, strlen(initial dst)). * If retval >= siz, truncation occurred. */ size_t strlcat(char* dst, const char* src, size_t siz) { char* d = dst; const char* s = src; size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; if (n == 0) return (dlen + strlen(s)); while (*s != '\0') { if (n != 1) { *d++ = *s; n--; } s++; } *d = '\0'; return (dlen + (s - src)); /* count does not include NUL */ } #endif system/osi/test/fuzzers/compat/fuzz_compat.cc +0 −2 Original line number Diff line number Diff line Loading @@ -51,8 +51,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) { size_t len_to_cpy = dataProvider.ConsumeIntegralInRange<size_t>(0, buf_size); strlcpy(reinterpret_cast<char*>(dst_buf), reinterpret_cast<char*>(bytes.data()), len_to_cpy); strlcat(reinterpret_cast<char*>(dst_buf), reinterpret_cast<char*>(bytes.data()), len_to_cpy); // Clear out our dest buffer free(dst_buf); Loading Loading
system/osi/include/compat.h +0 −3 Original line number Diff line number Diff line Loading @@ -31,7 +31,4 @@ pid_t gettid(void) throw(); /* Copy src to string dst of size siz. */ size_t strlcpy(char* dst, const char* src, size_t siz); /* Appends src to string dst of size siz. */ size_t strlcat(char* dst, const char* src, size_t siz); #endif
system/osi/src/compat.cc +0 −36 Original line number Diff line number Diff line Loading @@ -83,39 +83,3 @@ size_t strlcpy(char* dst, const char* src, size_t siz) { return (s - src - 1); /* count does not include NUL */ } #endif #if __GLIBC__ /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters * will be copied. Always NUL terminates (unless siz <= strlen(dst)). * Returns strlen(src) + MIN(siz, strlen(initial dst)). * If retval >= siz, truncation occurred. */ size_t strlcat(char* dst, const char* src, size_t siz) { char* d = dst; const char* s = src; size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; if (n == 0) return (dlen + strlen(s)); while (*s != '\0') { if (n != 1) { *d++ = *s; n--; } s++; } *d = '\0'; return (dlen + (s - src)); /* count does not include NUL */ } #endif
system/osi/test/fuzzers/compat/fuzz_compat.cc +0 −2 Original line number Diff line number Diff line Loading @@ -51,8 +51,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) { size_t len_to_cpy = dataProvider.ConsumeIntegralInRange<size_t>(0, buf_size); strlcpy(reinterpret_cast<char*>(dst_buf), reinterpret_cast<char*>(bytes.data()), len_to_cpy); strlcat(reinterpret_cast<char*>(dst_buf), reinterpret_cast<char*>(bytes.data()), len_to_cpy); // Clear out our dest buffer free(dst_buf); Loading