Initialize a char* that needs to be initialized.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jun 2014 23:07:47 +0000 (23:07 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jun 2014 23:07:47 +0000 (23:07 +0000)
<rdar://problem/15840022> and https://bugs.webkit.org/show_bug.cgi?id=133585

Reviewed by Mark Rowe.

r152134 (erroneously) removed this initialization.

* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::prepare): tail should start out initialized to 0.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169665 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/sql/SQLiteStatement.cpp

index eae6d1d..7fdc365 100644 (file)
@@ -1,3 +1,15 @@
+2014-06-06  Brady Eidson  <beidson@apple.com>
+
+        Initialize a char* that needs to be initialized.
+        <rdar://problem/15840022> and https://bugs.webkit.org/show_bug.cgi?id=133585
+
+        Reviewed by Mark Rowe.
+
+        r152134 (erroneously) removed this initialization.
+
+        * platform/sql/SQLiteStatement.cpp:
+        (WebCore::SQLiteStatement::prepare): tail should start out initialized to 0.
+
 2014-06-06  Alexey Proskuryakov  <ap@apple.com>
 
         [iOS] Support pasting HTML
 2014-06-06  Alexey Proskuryakov  <ap@apple.com>
 
         [iOS] Support pasting HTML
index ee1b88f..3ff6167 100644 (file)
@@ -71,7 +71,7 @@ int SQLiteStatement::prepare()
     // this lets SQLite avoid an extra string copy.
     size_t lengthIncludingNullCharacter = query.length() + 1;
 
     // this lets SQLite avoid an extra string copy.
     size_t lengthIncludingNullCharacter = query.length() + 1;
 
-    const char* tail;
+    const char* tail = nullptr;
     int error = sqlite3_prepare_v2(m_database.sqlite3Handle(), query.data(), lengthIncludingNullCharacter, &m_statement, &tail);
 
     if (error != SQLITE_OK)
     int error = sqlite3_prepare_v2(m_database.sqlite3Handle(), query.data(), lengthIncludingNullCharacter, &m_statement, &tail);
 
     if (error != SQLITE_OK)