C considered dangerous
C considered dangerous
Posted Sep 5, 2018 20:12 UTC (Wed) by rweikusat2 (subscriber, #117920)In reply to: C considered dangerous by anton
Parent article: C considered dangerous
Well, for the sake of the contrived example, let's assume that "during maintenance",
memcpy_s(buf, BUFLEN, src, len)
is changed to
memcpy_s(src, len, buf, BUFLEN)
now, there's no buffer overflow but likely a very serious memory corruption problem.
There's exactly no reason for this assumption except that's it's another way to break the working code but there wasn't any reason for your assumption, either.
