Fix an overflow found by ASAN.
Fix an overflow found by ASAN.

Sometimes len is 0.

Change-Id: I031000188edc57663a5519b00cbbb751600d32f4

xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base