summaryrefslogtreecommitdiff
path: root/tests/common/java/android/net/NetworkCapabilitiesTest.java
diff options
context:
space:
mode:
authorChiachang Wang <chiachangwang@google.com>2021-04-06 21:15:42 +0800
committerChiachang Wang <chiachangwang@google.com>2021-04-07 02:06:33 +0000
commit9024d7849ee953cda9befd2fc240ef1255bf7bc5 (patch)
treed127d382b0292141adc2d3b6b2edcd84512d39a8 /tests/common/java/android/net/NetworkCapabilitiesTest.java
parentd47c7d9765342ebe4ffb7a76ab636e7fc734b346 (diff)
Assign the bit calculation as long to prevent overflow
The value should be assigned as a long to do the bit calculation as the mNetworkCapabilities is intended to be a long. Otherwise, the value will be temporary assigned into an integer then assigned to the target long. When the bit shift calculation is out of the integer scope, the calculation will overflow and result in unexpected bebavior. Without assigning to a long, ConnectivityServiceTest will get Out-Of-Memory in StringBuilder while generating toString() in NetworkCapabilities after updating tests to verify NET_CAPABILITY_VSIM and NET_CAPABILITY_BIP. Bug: 130869457 Test: atest FrameworksNetTests Change-Id: I4d34c1215c7efb6dc352c314107792e3fa512ad7
Diffstat (limited to 'tests/common/java/android/net/NetworkCapabilitiesTest.java')
0 files changed, 0 insertions, 0 deletions