20 vulnerabilities classified as CWE-690 (未检查返回值导致空指针解引用). AI Chinese analysis included.
CWE-690 represents a critical logic flaw where software fails to verify the return value of a function that may yield a NULL pointer upon failure. This weakness typically manifests when developers assume successful execution without validating the output, leading directly to a NULL pointer dereference if the underlying operation encounters an error. Attackers exploit this vulnerability by triggering the specific error condition that causes the function to return NULL, thereby forcing the application to access invalid memory. This results in immediate program crashes, denial of service, or potentially arbitrary code execution if the NULL dereference can be manipulated to overwrite critical control structures. To mitigate this risk, developers must rigorously implement defensive programming practices by explicitly checking every function return value against NULL before proceeding with any pointer operations.
String username = getUserName(); if (username.equals(ADMIN_USER)) { ... }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); }Vulnerabilities classified as CWE-690 (未检查返回值导致空指针解引用) represent 20 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.