No this is what happens when guys whose entire professional career has been in C# and other languages that do a lot of memory work and cleanup for you get forced to program in an old language that makes the programmer handle it all themselves. I mean even the old programmers back in the day would screw this up. But “new” (people whose entire career has been in this century) programmers probably don’t even know this risk exists. The real question is why are they using C++? The product just isn’t old enough to justify that (the only justification being that was the new language when we started this app and we haven’t gotten around to rewriting it). Somebody made a dumb decision on day 1.
you nailed it ...
The newer coders won't be able to elicit the proper requirements from the clients or know how best to implement the poor requirements they got. But hey, that's why we have beta testers.
Because that is all you have when you are working with kernel-mode and boot-time drivers in Windows.
BTW, you can make the exact same class of error in other program languages too.
Automated code inspection tools improve the odds of catching errors, but they are not foolproof.
Automated unit testing improves the odds of catching errors, but it is not foolproof either.
The big failure was not testing this update with a variety of Windows systems, and not rolling out a sample population of the user base before a general distribution.
“whose entire professional career has been in C#”
Doesn’t c# run slower? Also I’d say that anytime you use new or malloc, you’d better check for a null result.
It’s legacy, just like Linux there’s few options for kernel programming. For Linux, it’s straight C...with Rust becoming a recent option, nothing else.
Back in the old days, like say 10 years ago and before, yes, C++ code was riddled with manual memory management bugs that caused all sorts of issues just like this. But with current C++ standards, manual memory management is minimized, and in some cases totally eliminated.
Obviously whoever maintained the driver code uses techniques that even today's C++ programmers would frown upon.
If it is a C# programmer being forced to use C++, it's time to get nervous, not because C++ is inherently dangerous, it is because the C# programmer isn't aware or was taught about the new safety features introduced to C++ over the past 10 years or so, and the C# programmer is relying on dusty old C++ books and teaching material to guide them.