Check buffer size before using it

Bug: 21814993
Change-Id: Idaac61b4b9f4058b94e84093644593ba315d72ff
1 file changed