diff options
| author | 2021-12-31 12:41:29 +0100 | |
|---|---|---|
| committer | 2021-12-31 12:41:29 +0100 | |
| commit | aa3ce435f69ca2eb6ec69cc0bb3a9228275af193 (patch) | |
| tree | d98f1e5c7eb4593fad9a29afab3aa5b616f2889f | |
| parent | fix savepoint InitError (diff) | |
| download | zig-sqlite-aa3ce435f69ca2eb6ec69cc0bb3a9228275af193.tar.gz zig-sqlite-aa3ce435f69ca2eb6ec69cc0bb3a9228275af193.tar.xz zig-sqlite-aa3ce435f69ca2eb6ec69cc0bb3a9228275af193.zip | |
add a test for a crash found by fuzzing
| -rw-r--r-- | sqlite.zig | 6 |
1 files changed, 5 insertions, 1 deletions
| @@ -3236,12 +3236,16 @@ test "sqlite: fuzzer found crashes" { | |||
| 3236 | .input = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00CREATE TABLE \x80\x00\x00\x00ar(Wb)\x01", | 3236 | .input = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00CREATE TABLE \x80\x00\x00\x00ar(Wb)\x01", |
| 3237 | .exp_error = error.SQLiteError, | 3237 | .exp_error = error.SQLiteError, |
| 3238 | }, | 3238 | }, |
| 3239 | .{ | ||
| 3240 | .input = "SELECT?", | ||
| 3241 | .exp_error = error.ExecReturnedData, | ||
| 3242 | }, | ||
| 3239 | }; | 3243 | }; |
| 3240 | 3244 | ||
| 3241 | inline for (test_cases) |tc| { | 3245 | inline for (test_cases) |tc| { |
| 3242 | var db = try getTestDb(); | 3246 | var db = try getTestDb(); |
| 3243 | defer db.deinit(); | 3247 | defer db.deinit(); |
| 3244 | 3248 | ||
| 3245 | try testing.expectError(tc.exp_error, db.exec(tc.input, .{}, .{})); | 3249 | try testing.expectError(tc.exp_error, db.execDynamic(tc.input, .{}, .{})); |
| 3246 | } | 3250 | } |
| 3247 | } | 3251 | } |