...
In particular, assertions are generally unsuitable for server programs or embedded systems. A failed assertion could can lead to a denial-of-service attack if a malicious user could can discover how to trigger it, such as if size
were in some way derived from client input. In such situations, a soft failure mode such as writing to a log file is more appropriate.
...