fix ANDROID-38: stack corruption in onSendPacketRequested

This commit is contained in:
Brenton Bostick 2023-02-02 11:34:18 -05:00
parent 132bff25df
commit 0a925a6f21
2 changed files with 3 additions and 2 deletions

View File

@ -402,7 +402,7 @@ namespace {
unsigned int bufferSize,
unsigned int ttl)
{
LOGV("WirePacketSendFunction(%lld, %p, %p, %d)", (long long)localSocket, remoteAddress, buffer, bufferSize);
LOGV("WirePacketSendFunction(%lld, %p, %p, %d, %u)", (long long)localSocket, remoteAddress, buffer, bufferSize, ttl);
JniRef *ref = (JniRef*)userData;
assert(ref->node == node);
@ -428,7 +428,7 @@ namespace {
return -102;
}
int retval = env->CallIntMethod(ref->packetSender, PacketSender_onSendPacketRequested_method, localSocket, remoteAddressObj, bufferObj);
int retval = env->CallIntMethod(ref->packetSender, PacketSender_onSendPacketRequested_method, localSocket, remoteAddressObj, bufferObj, 0);
LOGV("JNI Packet Sender returned: %d", retval);
return retval;

View File

@ -42,6 +42,7 @@ public interface PacketSender {
* @param localSocket socket file descriptor to send from. Set to -1 if not specified.
* @param remoteAddr {@link InetSocketAddress} to send to
* @param packetData data to send
* @param ttl TTL is ignored
* @return 0 on success, any error code on failure.
*/
public int onSendPacketRequested(