37 Commits

Author SHA1 Message Date
Guillaume Gomez
1f31021632 Fix wrong macro argument parsing 2025-08-17 16:28:45 +02:00
Markus Ebner
59a982028e Fix #563: filesizeformat with proper accuracy 2025-08-13 12:26:25 +02:00
Guillaume Gomez
e8572f4580 Fix invalid handling of paths starting with :: 2025-08-13 11:20:49 +02:00
René Kijewski
1f3c926c58 parser: r#self is not a valid raw identifier in macro calls
It's not a valid raw identifier anywhere, actually, but the other cases
(in a path, as a field name, as a macro name) were already handled.

Resolves <https://issues.oss-fuzz.com/issues/435218013>.
2025-07-31 18:46:35 +02:00
René Kijewski
d670d9b91c parser: fail on unterminated byte literal
Resolves <https://issues.oss-fuzz.com/issues/433650278>.

Also, I noticed that an Unicode escape in a byte literal, e.g.
`b'\u{42}'`, was accepted when it should not have been.
2025-07-28 21:56:40 +02:00
Guillaume Gomez
da0bdcc34b Add new fuzzing test case 2025-07-21 00:35:48 +02:00
René Kijewski
1836ffde5a parser: reject bare CR in doc comments
Resolves <https://issues.oss-fuzz.com/issues/431448399>.
2025-07-13 21:39:46 +02:00
René Kijewski
e8a3dba413 parser: reject isolated CR in macro inputs, too
Resolves <https://issues.oss-fuzz.com/issues/429645376>.
2025-07-07 19:11:04 +02:00
René Kijewski
d47b791957 parser: fix check_expr() recursion
`check_expr()` did not recurse for all recursive `Expr`s. This PR fixes
the problem.

Resolves <https://issues.oss-fuzz.com/issues/429130577>.
2025-07-05 21:08:44 +02:00
René Kijewski
c71aead21b parser: understand nested block comments in macro calls
Fixes <https://issues.oss-fuzz.com/issues/427825995>.
2025-06-29 11:21:33 +02:00
René Kijewski
3f380721a2 parser: reject illegal raw identifiers in attribute access 2025-06-23 18:31:16 +02:00
René Kijewski
76b26cd5fa parser: str lit must not be followed by suffix#
Resolves <https://issues.oss-fuzz.com/issues/426509683>.
2025-06-21 19:43:28 +02:00
René Kijewski
568ced0c55 parser: recognize comments in macro calls
Fixes issue <https://issues.oss-fuzz.com/issues/425145246>
2025-06-16 23:49:47 +02:00
René Kijewski
341b850351 parser: reject isolated CRs in string literals
According to <https://doc.rust-lang.org/reference/tokens.html#string-literals>.

Fixes <https://github.com/askama-rs/askama/issues/482>.
Fixes <https://issues.oss-fuzz.com/issues/424227903>.
2025-06-13 06:17:12 +02:00
René Kijewski
532e343c40 parser: reject illegal string literals 2025-06-09 19:24:08 +02:00
René Kijewski
d531c96d13 parser: recognize/reject prefixed ids and lits in macro calls 2025-06-05 18:44:02 +02:00
René Kijewski
96796cb1aa ci: don't collect filter output into String
We don't have to care if the output is big. If the user calls a filter
with a big input, then they should know that the output will probably be
even bigger.
2025-06-02 00:40:43 +02:00
René Kijewski
0e30499f59 ci: update fuzzing corpus to include derive 2025-06-01 19:14:28 +02:00
René Kijewski
e99f612391 Drive-by fixes 2025-05-18 23:06:42 +02:00
René Kijewski
b716014612 Fuzz code generator, too 2025-05-17 23:21:45 +02:00
René Kijewski
0ad2a3d973 Fuzz more filters
Added: `|escape`, `|filesizeformat`, `|join`, `|json`, `|json(..)`,
`|unique`, and `|wordcount`.
2025-05-16 16:23:20 +02:00
René Kijewski
7881bc131b Implement first and blank arguments for |indent 2025-04-17 15:07:21 +02:00
Guillaume Gomez
3b52c907c3 Rename rinja into askama 2025-03-11 19:31:06 +01:00
René Kijewski
84edf1cc77 Replace from_utf8_unsafe() with AsciiStr
This moves many unsafe block into one file.
2025-02-11 00:37:40 +01:00
René Kijewski
9b8ace77b4 Fix rust 1.86 clippy warnings
* [`manual_div_ceil`]
* [`sliced_string_as_bytes`]
* Add `cargo.toml` for global clippy settings, e.g. msrv

[`manual_div_ceil`]: <https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil>
[`sliced_string_as_bytes`]: <https://rust-lang.github.io/rust-clippy/master/index.html#sliced_string_as_bytes>
2025-01-31 21:22:33 +01:00
René Kijewski
d3a1afd99d fuzzing: update corpus 2025-01-04 18:25:38 +01:00
René Kijewski
d1287adf80 fuzzing: add option to write out fuzzed scenarios 2025-01-04 11:03:16 +01:00
René Kijewski
b49e42f0ea Use cargo reference manifest section order
In [#131] I added a check that ensures that the section in `Cargo.toml`
(and there values) are in a specific order. I invented the order quite
randomly, in the order which I thought might be useful.

This PR changes the order to be the same as in Cargo's reference about
[The Manifest Format]. Also some missing softlinks were added.

[#131]: <https://github.com/rinja-rs/rinja/pull/131>
[The Manifest Format]: <https://doc.rust-lang.org/cargo/reference/manifest.html>
2024-12-13 10:00:48 +01:00
René Kijewski
69ad5ea026 Remove integration crates 2024-11-25 03:03:15 +01:00
René Kijewski
0d8cda38b7 ci: make sure all settings apply to subprojects, too 2024-09-24 02:28:16 +02:00
René Kijewski
785aea3668 fuzz: add minified corpus after 1,000,000,000 runs 2024-08-29 17:05:42 +02:00
René Kijewski
757ba0ac7e doc: use feature(doc_cfg, doc_auto_cfg) everywhere 2024-08-20 07:36:11 +02:00
René Kijewski
22e6667217 Update after #141 was merged 2024-08-19 13:37:15 +02:00
René Kijewski
33e80a2be4 fuzz: fuzz text filters 2024-08-19 13:31:07 +02:00
René Kijewski
1176c654ba fuzz: fuzz everything at once 2024-08-19 13:31:07 +02:00
René Kijewski
79873f6a17 Make clippy happy 2024-08-19 13:31:07 +02:00
René Kijewski
8433e24917 filters: fuzzer for html escaping 2024-08-19 13:31:07 +02:00