src: Fix spurious buffer overflow issues