procrank: fix bounds check to prevent heap overflow am: 98a20cd128
am: 791e7afcfc

Change-Id: Ifec13ab874d4830a5af9ca05642d409818874ab0