Commit 54692cd
committed
Add regression tests for exqlite_changes, serialize, enable_load_extension, deserialize, set_update_hook
Each test was confirmed to crash with SIGSEGV (exit 139) on the unfixed NIF.
- "concurrent close and changes" — TOCTOU: conn->db NULL check is
outside the lock; concurrent close() can NULL the pointer between the
check and the sqlite3_changes() call inside the lock.
- "serialize after close" — sequential NULL-deref: no NULL guard
before sqlite3_serialize(conn->db, ...) after close() sets conn->db = NULL.
- "enable_load_extension after close" — no lock held at all, no NULL
guard; sqlite3_enable_load_extension(NULL, ...) after close() → crash.
- "deserialize after close" — sequential NULL-deref: no NULL guard
before sqlite3_deserialize(conn->db, ...) after close().
- "set_update_hook after close" — sequential NULL-deref: no NULL
guard before sqlite3_update_hook(conn->db, ...) after close().1 parent 602f122 commit 54692cd
1 file changed
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
898 | 898 | | |
899 | 899 | | |
900 | 900 | | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
901 | 963 | | |
902 | 964 | | |
0 commit comments