Skip to content

Commit a092ba5

Browse files
Wink SavilleAndroid Git Automerger
authored andcommitted
am e562287: Merge "[maguro] Update COMPREHENSION-TLV parser in CAT" into ics-mr0
* commit 'e562287c85662457864255028cd4bc3b04f13750': [maguro] Update COMPREHENSION-TLV parser in CAT
2 parents e5504ba + e562287 commit a092ba5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

telephony/java/com/android/internal/telephony/cat/ComprehensionTlv.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2006 The Android Open Source Project
2+
* Copyright (C) 2011 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@
2828
* {@hide}
2929
*/
3030
class ComprehensionTlv {
31+
private static final String LOG_TAG = "ComprehensionTlv";
3132
private int mTag;
3233
private boolean mCr;
3334
private int mLength;
@@ -88,8 +89,13 @@ public static List<ComprehensionTlv> decodeMany(byte[] data, int startIndex)
8889
int endIndex = data.length;
8990
while (startIndex < endIndex) {
9091
ComprehensionTlv ctlv = ComprehensionTlv.decode(data, startIndex);
91-
items.add(ctlv);
92-
startIndex = ctlv.mValueIndex + ctlv.mLength;
92+
if (ctlv != null) {
93+
items.add(ctlv);
94+
startIndex = ctlv.mValueIndex + ctlv.mLength;
95+
} else {
96+
CatLog.d(LOG_TAG, "decodeMany: ctlv is null, stop decoding");
97+
break;
98+
}
9399
}
94100

95101
return items;

0 commit comments

Comments
 (0)