MCPcopy Create free account
hub / github.com/Tencent/TscanCode / checkBufferAllocatedWithStrlen

Method checkBufferAllocatedWithStrlen

trunk/lib/checkbufferoverrun.cpp:1661–1704  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Checking for allocating insufficient memory for copying a string by allocating only strlen(src) bytes instead of strlen(src) + 1 bytes (one extra for the terminating null character). Example: char *b = malloc(strlen(a)); // Should be malloc(strlen(a) + 1); strcpy(b, a); // <== Buffer overrun ------------

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.80
tokAtMethod · 0.80
isCPPMethod · 0.45

Tested by

no test coverage detected