Don't read more than the buffer size.
am: 2f5f0ace27

Change-Id: I793c94207be6d2866ad1458e070805fccc971435