Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: third_party/WebKit/Source/modules/webdatabase/sqlite/SQLiteFileSystemWin.cpp

Issue 2769033002: [sql] WebSQL xGetLastError() can be called with null buffer. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 int chromiumSleep(sqlite3_vfs* vfs, int microseconds) { 148 int chromiumSleep(sqlite3_vfs* vfs, int microseconds) {
149 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); 149 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData);
150 return wrappedVfs->xSleep(wrappedVfs, microseconds); 150 return wrappedVfs->xSleep(wrappedVfs, microseconds);
151 } 151 }
152 152
153 int chromiumCurrentTime(sqlite3_vfs* vfs, double* prNow) { 153 int chromiumCurrentTime(sqlite3_vfs* vfs, double* prNow) {
154 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); 154 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData);
155 return wrappedVfs->xCurrentTime(wrappedVfs, prNow); 155 return wrappedVfs->xCurrentTime(wrappedVfs, prNow);
156 } 156 }
157 157
158 int chromiumGetLastError(sqlite3_vfs* vfs, int e, char* s) { 158 int chromiumGetLastError(sqlite3_vfs* vfs, int nBuf, char* zBuf) {
159 // xGetLastError() has never been used by SQLite. The implementation in 159 if (nBuf && zBuf)
160 // os_win.c indicates this is a reasonable implementation. 160 *zBuf = '\0';
161 *s = '\0';
162 return 0; 161 return 0;
163 } 162 }
164 163
165 } // namespace 164 } // namespace
166 165
167 void SQLiteFileSystem::registerSQLiteVFS() { 166 void SQLiteFileSystem::registerSQLiteVFS() {
168 sqlite3_vfs* wrappedVfs = sqlite3_vfs_find("win32"); 167 sqlite3_vfs* wrappedVfs = sqlite3_vfs_find("win32");
169 168
170 // These are implemented by delegating to |wrappedVfs|. 169 // These are implemented by delegating to |wrappedVfs|.
171 // TODO(shess): Implement local versions. 170 // TODO(shess): Implement local versions.
(...skipping 16 matching lines...) Expand all
188 chromiumDlSym, 187 chromiumDlSym,
189 chromiumDlClose, 188 chromiumDlClose,
190 chromiumRandomness, 189 chromiumRandomness,
191 chromiumSleep, 190 chromiumSleep,
192 chromiumCurrentTime, 191 chromiumCurrentTime,
193 chromiumGetLastError}; 192 chromiumGetLastError};
194 sqlite3_vfs_register(&chromium_vfs, 0); 193 sqlite3_vfs_register(&chromium_vfs, 0);
195 } 194 }
196 195
197 } // namespace blink 196 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698