Merge "fix possible buffer overrun in librank"