Skip to content

Commit

Permalink
Trampoline for __rawmemchr().
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 21, 2013
1 parent d43f6ec commit 75cf027
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions macelf/mactrampolines.c
Expand Up @@ -242,6 +242,14 @@ static void *mactrampoline___memcpy_chk(void *dst, const void *src, size_t len,
return memcpy(dst, src, len);
} // mactrampoline___memcpy_chk

static void *mactrampoline___rawmemchr(const void *s, int ch)
{
char *ptr = (char *) s;
while (((int) *ptr) != ch)
ptr++;
return ptr;
} // mactrampoline___rawmemchr

static char *mactrampoline___strcpy_chk(char *dst, const char *src, size_t dstlen)
{
STUBBED("check for overflow?");
Expand Down
1 change: 1 addition & 0 deletions macelf/mactrampolines.h
Expand Up @@ -49,6 +49,7 @@ MACTRAMPOLINE_OVERRIDE(__strncat_chk)
MACTRAMPOLINE_OVERRIDE(__memset_chk)
MACTRAMPOLINE_OVERRIDE(__memmove_chk)
MACTRAMPOLINE_OVERRIDE(__memcpy_chk)
MACTRAMPOLINE_OVERRIDE(__rawmemchr)
MACTRAMPOLINE_OVERRIDE(__strcpy_chk)
MACTRAMPOLINE_OVERRIDE(__strncpy_chk)
MACTRAMPOLINE_OVERRIDE(__snprintf_chk)
Expand Down

0 comments on commit 75cf027

Please sign in to comment.