summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-02-18 10:13:11 -0800
committerKenny Root <kroot@google.com>2010-02-18 10:13:11 -0800
commitf80efdf7e2b34ab8fec8f47052bf8386616ac312 (patch)
treec3f488464555dd1e39d6dec7f621470164dd162b /core/jni
parentc948cc8c8a8a9a751d8252e390e5975d1a763d34 (diff)
downloadframeworks_base-f80efdf7e2b34ab8fec8f47052bf8386616ac312.zip
frameworks_base-f80efdf7e2b34ab8fec8f47052bf8386616ac312.tar.gz
frameworks_base-f80efdf7e2b34ab8fec8f47052bf8386616ac312.tar.bz2
Adjust SQLiteDatabase/Program buffer sizes
Some error messages would have clobbered some memory adjacent to them, so increase the buffer sizes to fit them. Change-Id: I9c4a3f3444bf57b5d2bd1b7a2546e16137747ad0
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_database_SQLiteDatabase.cpp2
-rw-r--r--core/jni/android_database_SQLiteProgram.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/core/jni/android_database_SQLiteDatabase.cpp b/core/jni/android_database_SQLiteDatabase.cpp
index c197010..26d0e86 100644
--- a/core/jni/android_database_SQLiteDatabase.cpp
+++ b/core/jni/android_database_SQLiteDatabase.cpp
@@ -470,7 +470,7 @@ void throw_sqlite3_exception_errcode(JNIEnv* env, int errcode, const char* messa
if (errcode == SQLITE_DONE) {
throw_sqlite3_exception(env, errcode, NULL, message);
} else {
- char temp[20];
+ char temp[21];
sprintf(temp, "error code %d", errcode);
throw_sqlite3_exception(env, errcode, temp, message);
}
diff --git a/core/jni/android_database_SQLiteProgram.cpp b/core/jni/android_database_SQLiteProgram.cpp
index 32018eb..c247bbd 100644
--- a/core/jni/android_database_SQLiteProgram.cpp
+++ b/core/jni/android_database_SQLiteProgram.cpp
@@ -45,8 +45,8 @@ static jfieldID gStatementField;
static void native_compile(JNIEnv* env, jobject object, jstring sqlString)
{
- char buf[32];
- sprintf(buf, "android_database_SQLiteProgram->native_compile() not implemented");
+ char buf[65];
+ strcpy(buf, "android_database_SQLiteProgram->native_compile() not implemented");
throw_sqlite3_exception(env, GET_HANDLE(env, object), buf);
return;
}
@@ -152,8 +152,8 @@ static void native_clear_bindings(JNIEnv* env, jobject object)
static void native_finalize(JNIEnv* env, jobject object)
{
- char buf[32];
- sprintf(buf, "android_database_SQLiteProgram->native_finalize() not implemented");
+ char buf[66];
+ strcpy(buf, "android_database_SQLiteProgram->native_finalize() not implemented");
throw_sqlite3_exception(env, GET_HANDLE(env, object), buf);
return;
}