bug#78879: Potential Out-of-Memory in coreutils od

Paul Eggert <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Organization UCLA Computer Science Department
Message-ID <[email protected]>
On 2025-06-23 01:21, Jaehoon Jang wrote:
> This happens because the parsed -w value is passed to bytes_per_block,
> which is then used in a call to xnmalloc, leading to potentially dangerous
> memory allocation.

"Dangerous" in the sense that if you give "od" a large task it needs a 
lot of RAM? If so, most nontrivial programs are "dangerous".


> To mitigate this issue, we suggest adding a proper argument validation
> check to handle such edge cases safely.

No need for that. Just use 'ulimit -v' and set whatever limit you like. 
This will fix the danger that you perceive, not just for "od", but for 
all applications that you run. There's no need to change the apps.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.