* Fix coverity scan error for array comparison. * Check for buffer length overflow that fixes segfault.