There could be software that automatically detects buffer overflows at an Operating System level, so that the program is terminated and a security message is issued when it occurs that the programmer needs to fix the problem with their programming code before the program can restart. While these strict rules would not be ideal for servers, it’s much better than having the system compromised.
Another possibility is to monitor for the buffer overflow, and restore the previous memory state before the buffer overflowed into adjacent memory cells, so that it essentially puts a stop gap in the method of causing a buffer overflow.