That's one funky patch. The previous version of the variable wasn't getting
null-terminated?

A const string is always null-terminated. Maybe the problem was with it being
const?

Right, AFAICT the compiler was assuming that buffer is const. Later in the
code it is used to retrieve the architecture string from the PROM, and the
buffer[4] char then determines the arch. With the const assumption this
value was incorrectly set to 'c' at compile time, leading to misdetection
of the architecture.