Skip to content

Commit 6a8b38d

Browse files
authored
CBL-8585: Bounds check the peer ID (#503)
This was mistakenly passed as-is to JNI, but it is not always null terminated
1 parent 5b0328a commit 6a8b38d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

common/main/cpp/native_c4btsocketfactory.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static void btAttached(C4Socket* socket) {
176176
return;
177177
}
178178

179-
jstring jPeerID = env->NewStringUTF((const char *)ctx->peerID.buf);
179+
jstring jPeerID = toJString(env, ctx->peerID);
180180

181181
env->CallStaticVoidMethod(
182182
cls_C4BTSocketFactory, m_attached,

0 commit comments

Comments
 (0)