Add stpcpy/stpncpy.

Add tests for the above.

Add the fortify implementations of __stpcpy_chk and __stpncpy_chk.

Modify the strncpy test to cover more cases and use this template for
stpncpy.

Add all of the fortify test cases.

Bug: 13746695
Change-Id: I8c0f0d4991a878b8e8734fff12c8b73b07fdd344
This commit is contained in:
Christopher Ferris
2014-04-04 14:38:18 -07:00
parent 5f149f1bde
commit 950a58e24d
10 changed files with 557 additions and 99 deletions

View File

@@ -40,6 +40,8 @@
#define BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW 80120
#define BIONIC_EVENT_MEMSET_BUFFER_OVERFLOW 80125
#define BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW 80130
#define BIONIC_EVENT_STPCPY_BUFFER_OVERFLOW 80135
#define BIONIC_EVENT_STPNCPY_BUFFER_OVERFLOW 80140
#define BIONIC_EVENT_RESOLVER_OLD_RESPONSE 80300
#define BIONIC_EVENT_RESOLVER_WRONG_SERVER 80305