am 9da8b682: am c417d0a5: Merge "Make error messages even better!"

* commit '9da8b6829cb8febb70af46761b7f2ca19e6498ce':
  Make error messages even better!
This commit is contained in:
Nick Kralevich 2013-10-04 12:02:57 -07:00 committed by Android Git Automerger
commit 7909bd19ab
30 changed files with 32 additions and 32 deletions

View File

@ -224,4 +224,4 @@ END(__strcat_chk_failed)
.data
error_string:
.string "strcat buffer overflow"
.string "strcat prevented write past end of buffer"

View File

@ -185,4 +185,4 @@ END(__strcpy_chk_failed)
.data
error_string:
.string "strcpy buffer overflow"
.string "strcpy prevented write past end of buffer"

View File

@ -109,4 +109,4 @@ END(__memcpy_chk_fail)
.data
error_string:
.string "memcpy buffer overflow"
.string "memcpy prevented write past end of buffer"

View File

@ -197,4 +197,4 @@ END(memset)
.data
error_string:
.string "memset buffer overflow"
.string "memset prevented write past end of buffer"

View File

@ -227,4 +227,4 @@ END(__strcat_chk_fail)
.data
error_string:
.string "strcat buffer overflow"
.string "strcat prevented write past end of buffer"

View File

@ -191,4 +191,4 @@ END(__strcpy_chk_fail)
.data
error_string:
.string "strcpy buffer overflow"
.string "strcpy prevented write past end of buffer"

View File

@ -89,4 +89,4 @@ END(__memcpy_chk_fail)
.data
error_string:
.string "memcpy buffer overflow"
.string "memcpy prevented write past end of buffer"

View File

@ -201,4 +201,4 @@ END(__memset_large_copy)
.data
error_string:
.string "memset buffer overflow"
.string "memset prevented write past end of buffer"

View File

@ -401,4 +401,4 @@ END(memcpy)
.data
error_string:
.string "memcpy buffer overflow"
.string "memcpy prevented write past end of buffer"

View File

@ -130,4 +130,4 @@ END(memset)
.data
error_string:
.string "memset buffer overflow"
.string "memset prevented write past end of buffer"

View File

@ -222,4 +222,4 @@ END(__strcat_chk_failed)
.data
error_string:
.string "strcat buffer overflow"
.string "strcat prevented write past end of buffer"

View File

@ -184,4 +184,4 @@ END(__strcpy_chk_failed)
.data
error_string:
.string "strcpy buffer overflow"
.string "strcpy prevented write past end of buffer"

View File

@ -89,4 +89,4 @@ END(__memcpy_chk_fail)
.data
error_string:
.string "memcpy buffer overflow"
.string "memcpy prevented write past end of buffer"

View File

@ -116,4 +116,4 @@ END(memset)
.data
error_string:
.string "memset buffer overflow"
.string "memset prevented write past end of buffer"

View File

@ -49,7 +49,7 @@ extern "C" char *__fgets_chk(char *dest, int supplied_size,
}
if (((size_t) supplied_size) > dest_len_from_compiler) {
__fortify_chk_fail("fgets buffer overflow prevented", 0);
__fortify_chk_fail("fgets prevented write past end of buffer", 0);
}
return fgets(dest, supplied_size, stream);

View File

@ -46,7 +46,7 @@ extern "C" void *__memcpy_chk(void *dest, const void *src,
size_t copy_amount, size_t dest_len)
{
if (__predict_false(copy_amount > dest_len)) {
__fortify_chk_fail("memcpy buffer overflow prevented",
__fortify_chk_fail("memcpy prevented write past end of buffer",
BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW);
}

View File

@ -45,7 +45,7 @@ extern "C" void *__memmove_chk (void *dest, const void *src,
size_t len, size_t dest_len)
{
if (__predict_false(len > dest_len)) {
__fortify_chk_fail("memmove buffer overflow prevented",
__fortify_chk_fail("memmove prevented write past end of buffer",
BIONIC_EVENT_MEMMOVE_BUFFER_OVERFLOW);
}

View File

@ -43,7 +43,7 @@
*/
extern "C" void *__memset_chk (void *dest, int c, size_t n, size_t dest_len) {
if (__predict_false(n > dest_len)) {
__fortify_chk_fail("memset buffer overflow prevented",
__fortify_chk_fail("memset prevented write past end of buffer",
BIONIC_EVENT_MEMSET_BUFFER_OVERFLOW);
}

View File

@ -37,7 +37,7 @@ ssize_t __recvfrom_chk(int socket, void* buf, size_t len, size_t buflen, unsigne
const struct sockaddr* src_addr, socklen_t* addrlen)
{
if (__predict_false(len > buflen)) {
__fortify_chk_fail("recvfrom buffer overflow prevented", 0);
__fortify_chk_fail("recvfrom prevented write past end of buffer", 0);
}
return recvfrom(socket, buf, len, flags, src_addr, addrlen);

View File

@ -55,7 +55,7 @@ extern "C" char* __strcat_chk(
while ((*dest++ = *src++) != '\0') {
dest_buf_size--;
if (__predict_false(dest_buf_size == 0)) {
__fortify_chk_fail("strcat buffer overflow prevented",
__fortify_chk_fail("strcat prevented write past end of buffer",
BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW);
}
}

View File

@ -33,7 +33,7 @@
extern "C" char* __strchr_chk(const char* p, int ch, size_t s_len) {
for (;; ++p, s_len--) {
if (__predict_false(s_len == 0)) {
__fortify_chk_fail("strchr buffer overrun prevented", 0);
__fortify_chk_fail("strchr prevented read past end of buffer", 0);
}
if (*p == static_cast<char>(ch)) {
return const_cast<char*>(p);

View File

@ -45,7 +45,7 @@ extern "C" char *__strcpy_chk (char *dest, const char *src, size_t dest_len) {
// TODO: optimize so we don't scan src twice.
size_t src_len = strlen(src) + 1;
if (__predict_false(src_len > dest_len)) {
__fortify_chk_fail("strcpy buffer overflow prevented",
__fortify_chk_fail("strcpy prevented write past end of buffer",
BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW);
}

View File

@ -46,7 +46,7 @@ extern "C" size_t __strlcat_chk(char *dest, const char *src,
size_t supplied_size, size_t dest_len_from_compiler)
{
if (__predict_false(supplied_size > dest_len_from_compiler)) {
__fortify_chk_fail("strlcat buffer overflow prevented", 0);
__fortify_chk_fail("strlcat prevented write past end of buffer", 0);
}
return strlcat(dest, src, supplied_size);

View File

@ -46,7 +46,7 @@ extern "C" size_t __strlcpy_chk(char *dest, const char *src,
size_t supplied_size, size_t dest_len_from_compiler)
{
if (__predict_false(supplied_size > dest_len_from_compiler)) {
__fortify_chk_fail("strlcpy buffer overflow prevented", 0);
__fortify_chk_fail("strlcpy prevented write past end of buffer", 0);
}
return strlcpy(dest, src, supplied_size);

View File

@ -57,7 +57,7 @@ extern "C" size_t __strlen_chk(const char *s, size_t s_len) {
size_t ret = strlen(s);
if (__predict_false(ret >= s_len)) {
__fortify_chk_fail("strlen buffer overrun prevented", 0);
__fortify_chk_fail("strlen prevented read past end of buffer", 0);
}
return ret;

View File

@ -59,7 +59,7 @@ extern "C" char *__strncat_chk(
len--; dest_buf_size--;
if (__predict_false(dest_buf_size == 0)) {
__fortify_chk_fail("strncat buffer overflow prevented",
__fortify_chk_fail("strncat prevented write past end of buffer",
BIONIC_EVENT_STRNCAT_BUFFER_OVERFLOW);
}

View File

@ -45,7 +45,7 @@ extern "C" char* __strncpy_chk(char* __restrict dest, const char* __restrict src
size_t len, size_t dest_len)
{
if (__predict_false(len > dest_len)) {
__fortify_chk_fail("strncpy dest buffer overflow prevented",
__fortify_chk_fail("strncpy prevented write past end of buffer",
BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW);
}
@ -64,7 +64,7 @@ extern "C" char* __strncpy_chk2(char* __restrict dst, const char* __restrict src
size_t n, size_t dest_len, size_t src_len)
{
if (__predict_false(n > dest_len)) {
__fortify_chk_fail("strncpy dest buffer overflow prevented",
__fortify_chk_fail("strncpy prevented write past end of buffer",
BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW);
}
if (n != 0) {
@ -83,7 +83,7 @@ extern "C" char* __strncpy_chk2(char* __restrict dst, const char* __restrict src
size_t s_copy_len = static_cast<size_t>(s - src);
if (__predict_false(s_copy_len > src_len)) {
__fortify_chk_fail("strncpy buffer overrun prevented", 0);
__fortify_chk_fail("strncpy prevented read past end of buffer", 0);
}
}

View File

@ -37,7 +37,7 @@ extern "C" char* __strrchr_chk(const char *p, int ch, size_t s_len)
for (save = NULL;; ++p, s_len--) {
if (s_len == 0)
__fortify_chk_fail("strrchr read overrun prevented", 0);
__fortify_chk_fail("strrchr prevented read past end of buffer", 0);
if (*p == (char) ch)
save = (char *)p;
if (!*p)

View File

@ -51,7 +51,7 @@ extern "C" int __vsnprintf_chk(
va_list va)
{
if (__predict_false(supplied_size > dest_len_from_compiler)) {
__fortify_chk_fail("vsnprintf buffer overflow prevented", 0);
__fortify_chk_fail("vsnprintf prevented write past end of buffer", 0);
}
return vsnprintf(dest, supplied_size, format, va);

View File

@ -52,7 +52,7 @@ extern "C" int __vsprintf_chk(
int ret = vsnprintf(dest, dest_len_from_compiler, format, va);
if ((size_t) ret >= dest_len_from_compiler) {
__fortify_chk_fail("vsprintf buffer overflow prevented", 0);
__fortify_chk_fail("vsprintf prevented write past end of buffer", 0);
}
return ret;