summaryrefslogtreecommitdiffstats
path: root/crypto/src
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2013-05-29 10:33:37 -0700
committerKenny Root <kroot@google.com>2013-05-29 10:33:39 -0700
commitba293f770f28d1c480ae1a2e4bd2bff3c7dc2ccf (patch)
treef3657b2a838e4d28c87618c280eb1873d292f57f /crypto/src
parent5a77ade75d48732b5c46a08223f3538dc899be47 (diff)
downloadlibcore-ba293f770f28d1c480ae1a2e4bd2bff3c7dc2ccf.zip
libcore-ba293f770f28d1c480ae1a2e4bd2bff3c7dc2ccf.tar.gz
libcore-ba293f770f28d1c480ae1a2e4bd2bff3c7dc2ccf.tar.bz2
NativeCrypto: change debug format string to "%.*s"
This ensures the string stops at the right place instead of running off the end of the buffer. This still doesn't help much for binary data. Change-Id: Ia56b07a586d8f55ebb0d4237f6d598b307f065fe
Diffstat (limited to 'crypto/src')
-rw-r--r--crypto/src/main/native/org_conscrypt_NativeCrypto.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp b/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp
index 4f5bef0..c6c830f 100644
--- a/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp
+++ b/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp
@@ -7217,7 +7217,7 @@ static int sslRead(JNIEnv* env, SSL* ssl, jobject fdObject, jobject shc, char* b
#ifdef WITH_JNI_TRACE_DATA
for (int i = 0; i < result; i+= WITH_JNI_TRACE_DATA_CHUNK_SIZE) {
int n = std::min(result - i, WITH_JNI_TRACE_DATA_CHUNK_SIZE);
- JNI_TRACE("ssl=%p sslRead data: %d:\n%*s", ssl, n, n, buf+i);
+ JNI_TRACE("ssl=%p sslRead data: %d:\n%.*s", ssl, n, n, buf+i);
}
#endif
@@ -7421,7 +7421,7 @@ static int sslWrite(JNIEnv* env, SSL* ssl, jobject fdObject, jobject shc, const
#ifdef WITH_JNI_TRACE_DATA
for (int i = 0; i < result; i+= WITH_JNI_TRACE_DATA_CHUNK_SIZE) {
int n = std::min(result - i, WITH_JNI_TRACE_DATA_CHUNK_SIZE);
- JNI_TRACE("ssl=%p sslWrite data: %d:\n%*s", ssl, n, n, buf+i);
+ JNI_TRACE("ssl=%p sslWrite data: %d:\n%.*s", ssl, n, n, buf+i);
}
#endif