fix fread buffer has no terminating null string

do not allocate memory where it is not needed

Change-Id: I8ab4f7d36173c59aa74a590581a0f7027b7d8a69
Merge branch 'cm-11.0' of github.com:CyanogenMod/android_bootable_recovery into cm-11.0