Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f02798b9 authored by Andreas Gampe's avatar Andreas Gampe
Browse files

Frameworks: Fix scoping problem in SQLite

Fix the scope of a std::string to avoid a use-after-free.

Test: m && SANITIZE_TARGET=address m
Change-Id: I4b4c299b4ab2c82d76489cc68a398f33b6220e32
parent be982d72
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -223,8 +223,8 @@ void throw_sqlite3_exception(JNIEnv* env, int errcode,
    if (sqlite3Message) {
        String8 fullMessage;
        fullMessage.append(sqlite3Message);
        const char* errcode_msg = sqlite3_error_code_to_msg(errcode).c_str();
        fullMessage.appendFormat(" (code %s)", errcode_msg); // print extended error code
        std::string errcode_msg = sqlite3_error_code_to_msg(errcode);
        fullMessage.appendFormat(" (code %s)", errcode_msg.c_str()); // print extended error code
        if (message) {
            fullMessage.append(": ");
            fullMessage.append(message);