Nowadays it is possible to catch these kinds of errors ahead of time and at runtime with some help from static analyzers and other special tools, like AddressSanitizer. This report itself is likely to be the result of such work.
So, rewrite is not worthwhile if your reasoning is to prevent edge cases in managing memory.