install: Fix possible memory overflows