Avoid confusing "read prevented write" log messages.

Moving to a "function: message" style avoids ambiguity.

Change-Id: If9d590e50265c61725d3673bd03796e65edd2d5e
This commit is contained in:
Elliott Hughes
2013-10-15 16:43:38 -07:00
parent dc9d8d050a
commit d1eda33f01
22 changed files with 187 additions and 237 deletions

View File

@@ -31,17 +31,17 @@
#include <string.h>
#include "private/libc_logging.h"
extern "C" char* __strrchr_chk(const char *p, int ch, size_t s_len)
{
char *save;
for (save = NULL;; ++p, s_len--) {
if (s_len == 0)
__fortify_chk_fail("strrchr prevented read past end of buffer", 0);
if (*p == (char) ch)
save = (char *)p;
if (!*p)
return(save);
extern "C" char* __strrchr_chk(const char *p, int ch, size_t s_len) {
for (char* save = NULL;; ++p, s_len--) {
if (s_len == 0) {
__fortify_chk_fail("strrchr: prevented read past end of buffer", 0);
}
/* NOTREACHED */
if (*p == (char) ch) {
save = (char *)p;
}
if (!*p) {
return(save);
}
}
/* NOTREACHED */
}