4 ms·
> In other words, a silly patch that fixes a non-problem in one tiny place in a huge codebase doesn't accomplish anything. I don't understand this line of thin
by dezgeg 12y ago
> In other words, a silly patch that fixes a non-problem in one tiny place in a huge codebase doesn't accomplish anything.
I don't understand this line of thinking at all.
"reallocarray()/kmalloc_array() doesn't fix all the possible integer overflow issues in C, so why bother using it at all."
Several people in this discussion have mentioned exact vulnerabilities that would have been prevented by reallocarray():
meowface:
"Here is one of many examples of an integer overflow resulting in an improper size being passed to a memory allocation function further leading to remote code execution: https://docs.google.com/document/d/1tHElG04AJR5OR2Ex-m_Jsmc8S5fAbRB3s4RmTG_PFnw/edit https://docs.google.com/document/d/1tHElG04AJR5OR2Ex-m_Jsmc8... "
tedunangst:
"You've never heard of the one openssh exploit?"
- kazinator 12y agoThe discussion has changed; it is about the pointless patch to some USB code where an 8 bit endpoint count is multiplied by the size of some structure.
- kazinator 12y agoI took realloc_array and applied it to a program I'm working on which contains a bunch of realloc calls. It was completely useless; I had to invent a different interface. It was useless because several calculations take place in every instance to produce the size, whereas realloc_array only checks one multiplication.