From baab3f4d3c34c7766780e1a38a8e96d04403b4b9 Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Sun, 14 May 2023 09:37:50 +0100 Subject: [PATCH] Use snprintf instead. Signed-off-by: Kenneth J. Shackleton --- selekt-sqlite3/sqlite3_jni.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selekt-sqlite3/sqlite3_jni.cpp b/selekt-sqlite3/sqlite3_jni.cpp index d3a8760200..179ddc0c82 100644 --- a/selekt-sqlite3/sqlite3_jni.cpp +++ b/selekt-sqlite3/sqlite3_jni.cpp @@ -65,7 +65,7 @@ static jint rawKey( int i; char * const hex = sql + prefix.length(); for (i = 0; i < keyLength; ++i) { - std::sprintf(hex + (2 * i), "%02x", key[i]); + std::snprintf(hex + (2 * i), 3, "%02x", key[i]); } std::strcpy(sql + length - suffix.length(), suffix.c_str()); auto result = sqlite3_exec(reinterpret_cast(jdb), sql, nullptr, nullptr, nullptr);