140 vulnerabilities classified as CWE-788 (在缓冲区结束位置之后访问内存). AI Chinese analysis included.
CWE-788 represents a critical memory safety vulnerability where software accesses memory locations beyond the allocated boundaries of a buffer. This weakness typically arises from improper pointer arithmetic or off-by-one errors during index manipulation, allowing attackers to read sensitive data or write malicious payloads into adjacent memory regions. Exploitation often leads to information disclosure, application crashes, or arbitrary code execution, depending on the memory layout and attacker control. Developers can prevent this by implementing rigorous bounds checking before any memory access, utilizing safe string handling libraries that enforce length limits, and adopting static analysis tools to detect out-of-bounds references during the coding phase. Furthermore, employing memory-safe programming languages or compiler protections like Address Sanitizers helps identify these errors early, ensuring that buffer indices remain strictly within valid limits throughout the application’s lifecycle.
void host_lookup(char *user_supplied_addr){ struct hostent *hp; in_addr_t *addr; char hostname[64]; in_addr_t inet_addr(const char *cp); /*routine that ensures user_supplied_addr is in the right format for conversion */ validate_addr_form(user_supplied_addr); addr = inet_addr(user_supplied_addr); hp = gethostbyaddr( addr, sizeof(struct in_addr), AF_INET); strcpy(hostname, hp->h_name); }int returnChunkSize(void *) { /* if chunk info is valid, return the size of usable memory, * else, return -1 to indicate an error */ ... } int main() { ... memcpy(destBuf, srcBuf, (returnChunkSize(destBuf)-1)); ... }Vulnerabilities classified as CWE-788 (在缓冲区结束位置之后访问内存) represent 140 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.