Fix memory access violation in NetworkStack
Fix memory access violation in com_android_networkstack_tethering_BpfUtils.cpp caused by invalid format string in com_android_networkstack_tethering_BpfUtils_isEthernet. If rv is not valid, jniThrowException will format a string using "Unknown hardware address type %s on interface %s". However, rv is an int but here "%s" is used in fmt string, thus causing access violation of memory. Use "%d" instead of "%s" for int. Bug: 188757793 Original-Change: https://android-review.googlesource.com/1715797 Merged-In: I9d8ec0708efd747e24b3b3ffed5336434d4f64a7 Change-Id: I9d8ec0708efd747e24b3b3ffed5336434d4f64a7
This commit is contained in:
committed by
Nucca Chen
parent
58b943a701
commit
365ada7e04
@@ -183,7 +183,7 @@ static jboolean com_android_networkstack_tethering_BpfUtils_isEthernet(JNIEnv* e
|
|||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
jniThrowExceptionFmt(env, "java/io/IOException",
|
jniThrowExceptionFmt(env, "java/io/IOException",
|
||||||
"Unknown hardware address type %s on interface %s", rv,
|
"Unknown hardware address type %d on interface %s", rv,
|
||||||
interface.c_str());
|
interface.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user