CWE-469 使用指针的减法来确定大小 类弱点 1 条 CVE 漏洞汇总,含 AI 中文分析。
CWE-469 属于指针算术错误漏洞。当开发者通过减去两个指针来计算缓冲区大小时,若这两个指针不属于同一内存块,计算结果将不准确,可能导致缓冲区越界读写。攻击者可利用此缺陷触发内存破坏,进而执行任意代码或导致服务崩溃。开发者应避免跨内存块进行指针减法,改用显式长度参数或标准库函数来管理内存大小,确保计算逻辑的严谨性与安全性。
struct node { int data; struct node* next; }; // Returns the number of nodes in a linked list from // the given pointer to the head of the list. int size(struct node* head) { struct node* current = head; struct node* tail; while (current != NULL) { tail = current; current = current->next; } return tail - head; } // other methods for manipulating the list ...... int size(struct node* head) { struct node* current = head; int count = 0; while (current != NULL) { count++; current = current->next; } return count; }| CVE ID | 标题 | CVSS | 风险等级 | Published |
|---|---|---|---|---|
| CVE-2019-25595 | jetAudio 安全漏洞 — jetAudio | 6.2 | Medium | 2026-03-22 |
CWE-469(使用指针的减法来确定大小) 是常见的弱点类别,本平台收录该类弱点关联的 1 条 CVE 漏洞。