MCPcopy Create free account
hub / github.com/acl-dev/acl / strndup_hook

Function strndup_hook

lib_acl_cpp/samples/winaio/heap_hook.cpp:507–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505}
506
507static char *strndup_hook(const char* fname, int lineno, const char* ptr, size_t n)
508{
509 printf(">>>%s\n", __FUNCTION__);
510
511 size_t len = strlen(ptr);
512 if (len > n)
513 len = n;
514 char* s = (char*) malloc_hook(fname, lineno, len + 1);
515 memcpy(s, (const char*) ptr, len);
516 s[len] = 0;
517 return s;
518}
519
520static void *memdup_hook(const char* fname, int lineno, const void* ptr, size_t n)
521{

Callers

nothing calls this directly

Calls 2

memcpyFunction · 0.85
malloc_hookFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…