commented out some debug prints

master
bx 2021-12-27 08:17:19 +00:00
parent 8bde12a2bb
commit f7c8686110
1 changed files with 11 additions and 4 deletions

View File

@ -9,6 +9,13 @@
// prefix for debug prints
#define SSS "-fillin-\t"
// TODO: use this to enable / disable debug prints
#if 1
# define DBP printf
#else
# define DBP(...)
#endif
// https://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libc---strcpy-chk-1.html
// TODO: actually check for overflows
char * __strcpy_chk(char * dest, const char * src, size_t destlen) {
@ -28,7 +35,7 @@ char * __strcpy_chk(char * dest, const char * src, size_t destlen) {
// https://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libc---stpcpy-chk-1.html
char * __stpcpy_chk(char * dest, const char * src, size_t destlen) {
printf(SSS "STPCPY %s :::: %s\n", src, dest);
// printf(SSS "STPCPY %s :::: %s\n", src, dest);
return stpcpy(dest, src);
}
@ -36,7 +43,7 @@ char * __stpcpy_chk(char * dest, const char * src, size_t destlen) {
// https://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libc---strncpy-chk-1.html
char * __strncpy_chk(char * dest, const char * src, size_t n, size_t dest_1len) {
printf(SSS "STRNCPY %s :::: %s\n", src, dest);
// printf(SSS "STRNCPY %s :::: %s\n", src, dest);
return strncpy(dest, src, n);
}
@ -44,7 +51,7 @@ char * __strncpy_chk(char * dest, const char * src, size_t n, size_t dest_1len)
// https://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libc---strcat-chk-1.html
// TODO: There's some good info being dumped here
char * __strcat_chk(char * dest, const char * src, size_t destlen) {
printf("!!! strcat %s :::: %s\n", src, dest);
// printf("!!! strcat %s :::: %s\n", src, dest);
char *res = strncat(dest, src, destlen);
@ -62,7 +69,7 @@ void * __memcpy_chk(void * dest, const void * src, size_t len, size_t destlen) {
// https://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libc---memset-chk-1.html
void * __memset_chk(void * dest, int c, size_t len, size_t destlen) {
puts(SSS "MEMSET\n");
// puts(SSS "MEMSET\n");
return memset(dest, c, len);
}