Guard against infinite loops with recursive links traversal

This commit is contained in:
Mickaël Menu 2021-02-27 18:15:42 +01:00
parent 81f3aaa6fa
commit ac545f550a
No known key found for this signature in database
GPG Key ID: 53D73664CD359895
4 changed files with 4 additions and 4 deletions

View File

@ -526,6 +526,9 @@ func (d *NoteDAO) findRows(opts note.FinderOpts) (*sql.Rows, error) {
query += fmt.Sprintf(" AND tc.distance < %d", maxDistance)
}
// Guard against infinite loops by limiting the number of recursions.
query += "\n LIMIT 100000"
query += "\n)\n"
}

View File

@ -1,4 +1,5 @@
[note]
filename = "{{slug title}}"
template = "default.md"
[tool]

View File

@ -1,7 +1,5 @@
# Send notes for processing by other programs
<!-- TODO: --color=none -->
A great way to expand `zk` feature set is to explore a wealth of command-line tools available. You can use `zk`'s powerful [searching and filtering](note-filtering.md) capabilities to select notes before delegating further processing to other programs.
## Process file paths

View File

@ -1,7 +1,5 @@
# Styling
<!-- TODO: semantic rules -->
`zk` supports a `{{style}}` [template helper](template.md) to format its output with colors and font decorations.
Usage: `{{style "<rules>" "<text>"}}`