diff --git a/src/common.cpp b/src/common.cpp index 952a489..db1485b 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -201,6 +201,10 @@ const char* shim::strchr_chk(const char* __s, int __ch, size_t __n) { return strchr(__s, __ch); } +const char* shim::strrchr_chk(const char* __s, int __ch, size_t __n) { + return strrchr(__s, __ch); +} + #ifndef __LP64__ int shim::ftruncate(int fd, bionic::off_t len) { return ::ftruncate(fd, (::off_t) len); @@ -843,6 +847,7 @@ void shim::add_string_shimmed_symbols(std::vector &list) { {"strlen", ::strlen}, {"__strlen_chk", strlen_chk}, {"__strchr_chk", strchr_chk}, + {"__strrchr_chk", strrchr_chk}, {"strcmp", ::strcmp}, {"strcpy", ::strcpy}, {"__strcpy_chk", __strcpy_chk}, diff --git a/src/common.h b/src/common.h index a83f855..4779c37 100644 --- a/src/common.h +++ b/src/common.h @@ -72,6 +72,7 @@ namespace shim { size_t strlen_chk(const char *str, size_t max_len); const char* strchr_chk(const char* __s, int __ch, size_t __n); + const char* strrchr_chk(const char* __s, int __ch, size_t __n); #ifndef __LP64__ /* Bionic uses a 32-bit off_t; this doesn't match up on Darwin so let's