[haiku-commits] Change in haiku[master]: kernel/elf: Replace sprintf with snprintf

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 25 Nov 2019 19:30:56 +0000

From Andrej Antunovic <tunas@xxxxxxxxxxxxx>:

Andrej Antunovic has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/1975 ;)


Change subject: kernel/elf: Replace sprintf with snprintf
......................................................................

kernel/elf: Replace sprintf with snprintf

In two places in elf.cpp, sprintf is used which does not check for buffer 
overflows. This could potentially lead to malicious executables trying to reach 
memory
they are not supposed to. Instead, it's possible to use snprintf with a 
sizeof() call.
I'm not very well-versed into C/C++, so this is just based on what I've 
learned. Please do provide feedback, I would like to get into more useful 
contributions :)
---
M src/system/kernel/elf.cpp
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/75/1975/1
-- 
To view, visit https://review.haiku-os.org/c/haiku/+/1975
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I9c36a9938f9c99b3849e77aa9cd2eab313f5bb95
Gerrit-Change-Number: 1975
Gerrit-PatchSet: 1
Gerrit-Owner: Andrej Antunovic <tunas@xxxxxxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts: