Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

15
  • 2
    This question requires probably a much longer answer than you thought, and some of our hardliners will surely downvote and close-vote it ("needs more focus"). Still, I like it. Commented Jun 14, 2024 at 14:42
  • 7
    Of course its possible to write memory-safe C++ code, you just can't prove that the code is safe using the type system. You can use the type system + linters + sanitizers + fuzzing to reduce the likelihood of memory safety issues. One thing that you're missing is that the smart pointers can still be nullptr, and that vector doesn't do bounds checks. I wouldn't think about rewriting, but about adopting security-conscious modern C++ practices, and about investigating safer languages for future components. Commented Jun 14, 2024 at 15:51
  • 3
    @JimmyJames. You're right, the remediation needs to make sense to a non-technical audience. There is no immediate consequence of non-compliance, but it can be at some point in future. Commented Jun 14, 2024 at 16:50
  • 4
    If someone nontechnical is feeling alarmed or worried about this report and nobody has identified any specific risks to the business/customers/etc, then it sounds like the most important thing is reassurance, stakeholder management and communication. You could counter this by pointing out that having a system built around unsafe code doesn't necessarily mean any imminent risk to the business - especially if that code has already proven itself over years. Commented Jun 14, 2024 at 19:48
  • 3
    The key think I would make sure the non-technical stakeholders understand is how disastrously bad it will likely go if you attempted to rewrite the entire application in one shot using another language/platform. If it's decided that a rewrite is needed, the first thing to figure out is how you can do it one piece at a time. Otherwise, you need a mitigation strategy. It might need to be someone's job to implement software security practices. There's a lot of information about the things to look out for with C and C++. Largely because there's a lot to look out for. Commented Jun 14, 2024 at 21:58