am f8b69275: am f20d6b32: Recover from corrupt network stats.
* commit 'f8b692754f7739e11c8438ab59c0760194cfacc5': Recover from corrupt network stats.
This commit is contained in:
@@ -639,6 +639,7 @@ public class NetworkStatsHistory implements Parcelable {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public static long[] readFullLongArray(DataInputStream in) throws IOException {
|
public static long[] readFullLongArray(DataInputStream in) throws IOException {
|
||||||
final int size = in.readInt();
|
final int size = in.readInt();
|
||||||
|
if (size < 0) throw new ProtocolException("negative array size");
|
||||||
final long[] values = new long[size];
|
final long[] values = new long[size];
|
||||||
for (int i = 0; i < values.length; i++) {
|
for (int i = 0; i < values.length; i++) {
|
||||||
values[i] = in.readLong();
|
values[i] = in.readLong();
|
||||||
@@ -680,6 +681,7 @@ public class NetworkStatsHistory implements Parcelable {
|
|||||||
public static long[] readVarLongArray(DataInputStream in) throws IOException {
|
public static long[] readVarLongArray(DataInputStream in) throws IOException {
|
||||||
final int size = in.readInt();
|
final int size = in.readInt();
|
||||||
if (size == -1) return null;
|
if (size == -1) return null;
|
||||||
|
if (size < 0) throw new ProtocolException("negative array size");
|
||||||
final long[] values = new long[size];
|
final long[] values = new long[size];
|
||||||
for (int i = 0; i < values.length; i++) {
|
for (int i = 0; i < values.length; i++) {
|
||||||
values[i] = readVarLong(in);
|
values[i] = readVarLong(in);
|
||||||
|
|||||||
Reference in New Issue
Block a user