As far as I know, there's no guarantee that subsequent malloc calls will be in a contiguous block of memory. The overflow attack is simple enough but it seems like static allocation would've worked better here as it's entirely possible that there are n random bytes between the two buffers. |
==> |