am 30d77e2c: Fix potential buffer overrun

* commit '30d77e2c75c1973f9fb363717af92cf640685da3':
  Fix potential buffer overrun