You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also adds a couple of validation steps:
- guard against large queries to prevent a segfault trying to allocate
more memory than is available on the stack
- guard against null values in the protobuf ast passed to deparse.
And adds fuzzing to the library. This found a single problem, which was
caused by NULLs in the AST passed to deparse.
Copy file name to clipboardExpand all lines: README.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,46 @@ def deps do
35
35
end
36
36
```
37
37
38
+
## Fuzzing
39
+
40
+
The `fuzz/` directory contains [libFuzzer](https://llvm.org/docs/LibFuzzer.html) harnesses that exercise the NIF boundary. You need clang with libFuzzer support (standard in most LLVM distributions).
41
+
42
+
Build all four targets:
43
+
44
+
```bash
45
+
make fuzz
46
+
```
47
+
48
+
Optionally seed the deparse corpus from known-good SQL strings:
49
+
50
+
```bash
51
+
make fuzz-corpus
52
+
```
53
+
54
+
Then run a target, for example:
55
+
56
+
```bash
57
+
# Fuzz the parse → deparse round-trip (highest-value target)
Crash artifacts are written to `fuzz/crashes/` (the `-artifact_prefix` flag controls this; without it libFuzzer writes to the current directory). Replay a crash by passing the file as a positional argument:
71
+
72
+
```bash
73
+
fuzz/_build/fuzz_roundtrip fuzz/crashes/<file>
74
+
```
75
+
76
+
Clean up build artefacts and generated corpus with `make fuzz-clean`.
77
+
38
78
## License
39
79
40
80
This Elixir interface is distributed under the terms of the [Apache 2.0 license](./LICENSE).
- This avoids a crash for callers that read the error field of the result when there is no error
11
+
12
+
## 17-6.2.1 2026-01-14
13
+
14
+
* Add pg_query_is_utility_stmt function to determine if query text contains utility statements [#313](https://github.com/pganalyze/libpg_query/pull/313)
15
+
* This is a fast check for callers that don't actually need the parse tree itself
16
+
* Add missing top-level postgres_deparse.h in Makefile install step
17
+
- This was an oversight from the previous 6.2.0 release
18
+
* Improve pg_query_summary function:
19
+
- Speed up summary truncate replacement logic
20
+
- Correctly handle `GRANT .. ON ALL TABLES IN SCHEMA` statements
.PHONY: all clean build build_shared extract_source examples test install
117
117
118
118
$(PGDIR):
119
-
# We temporarily build off REL_17_STABLE to pull in https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=6da2ba1d8a031984eb016fed6741bb2ac945f19d
120
-
# TODO: Go back to upstream tarball once 17.5 is released
0 commit comments