From d010165f0854cf812a9ceb9403f8247130a1858e Mon Sep 17 00:00:00 2001 From: "Matthew \"strager\" Glazar" Date: Sun, 25 Feb 2024 01:10:35 -0500 Subject: [PATCH 1/3] fix(arch): disable failing lint checks --- dist/arch/lint.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dist/arch/lint.sh b/dist/arch/lint.sh index 839a5d6963..e394e746e4 100755 --- a/dist/arch/lint.sh +++ b/dist/arch/lint.sh @@ -11,10 +11,21 @@ cd "$(dirname "${0}")" errors="$(mktemp)" trap 'rm -f "${errors}"' EXIT +# HACK(strager): Disable the symlink check. The debug package +# references files in the main package +# (usr/lib/debug/.build-id/7d/de35aceb40462c945841b0d88b87fdfab87ea5 +# points to ../../../../bin/quick-lint-js), but because namcap lints +# each package separately, namcap doesn't see the file from the main +# package when linting the debug package. +# +# HACK(strager): Disable the emptydir check. The debug package, +# created automatically with OPTIONS=(debug strip), has an empty +# directory (usr/src/debug/quick-lint-js-dev/quick-lint-js/build). +# # HACK(strager): Disable the unusedsodepends check. With -Wl,--gc-sections, the # check fails on libm. Even with -Wl,--as-needed, the linker keeps the NEEDED # entry, so I don't know how to work around the libm dependency. -namcap --exclude=unusedsodepends PKGBUILD-dev PKGBUILD-git PKGBUILD-release ./quick-lint-js-*.pkg.tar.zst |& tee "${errors}" +namcap --exclude=emptydir,symlink,unusedsodepends PKGBUILD-dev PKGBUILD-git PKGBUILD-release ./quick-lint-js-*.pkg.tar.zst |& tee "${errors}" if [ -s "${errors}" ]; then printf 'error: namcap reported an error\n' >&2 exit 1 From 02a1c8949b4fc1a897afa90dc871eda74d6f9764 Mon Sep 17 00:00:00 2001 From: "Matthew \"strager\" Glazar" Date: Sun, 25 Feb 2024 01:29:17 -0500 Subject: [PATCH 2/3] fix(fe): fix buffer overflow during keyword checking --- docs/CHANGELOG.md | 3 +++ src/quick-lint-js/fe/lex.cpp | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index edd93b8219..fd03af559f 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -19,6 +19,9 @@ Semantic Versioning. * TypeScript: `(): RT=>null` (with no spaces in `>=>`) now parses correctly. (Fixed by [vegerot][].) +* Fixed a read buffer overflow (possibly leading to a crash) when checking + whether short identifiers containing Unicode escape sequences are keywords. + (x86 and x86_64 only.) (Reported by [Roland Strasser][].) ## 3.1.0 (2024-01-10) diff --git a/src/quick-lint-js/fe/lex.cpp b/src/quick-lint-js/fe/lex.cpp index 72c41b7a93..5c5be9a91d 100644 --- a/src/quick-lint-js/fe/lex.cpp +++ b/src/quick-lint-js/fe/lex.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -1832,9 +1833,15 @@ Lexer::Parsed_Identifier Lexer::parse_identifier_slow( } } + String8_View normalized_view = normalized.release_to_string_view(); + + // Add padding bytes required by Keyword_Lexer. This should not be considered + // part of the returned string. + normalized.resize(normalized.size() + Keyword_Lexer::padding_size); + return Parsed_Identifier{ .after = input, - .normalized = normalized.release_to_string_view(), + .normalized = normalized_view, .escape_sequences = escape_sequences, }; } From 6ecf40851a57aa26ff88dda3f149007b9cc92277 Mon Sep 17 00:00:00 2001 From: "Matthew \"strager\" Glazar" Date: Sun, 25 Feb 2024 01:34:54 -0500 Subject: [PATCH 3/3] chore(docs): update changelog --- docs/CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index fd03af559f..a19a6edea5 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -19,9 +19,12 @@ Semantic Versioning. * TypeScript: `(): RT=>null` (with no spaces in `>=>`) now parses correctly. (Fixed by [vegerot][].) +* Fixed [E0718][] falsely diagnosing valid code. ([#1192][], [#1199][]) +* quick-lint-js no longer crashes in the presence of symbolic links and + directory junctions on Windows. ([#1182][]) * Fixed a read buffer overflow (possibly leading to a crash) when checking whether short identifiers containing Unicode escape sequences are keywords. - (x86 and x86_64 only.) (Reported by [Roland Strasser][].) + (x86 and x86_64 only.) ([#1191][]) ## 3.1.0 (2024-01-10) @@ -1419,7 +1422,11 @@ Beta release. [#1168]: https://github.com/quick-lint/quick-lint-js/pull/1168 [#1171]: https://github.com/quick-lint/quick-lint-js/issues/1171 [#1180]: https://github.com/quick-lint/quick-lint-js/issues/1180 +[#1182]: https://github.com/quick-lint/quick-lint-js/issues/1182 +[#1191]: https://github.com/quick-lint/quick-lint-js/issues/1191 +[#1192]: https://github.com/quick-lint/quick-lint-js/issues/1192 [#1194]: https://github.com/quick-lint/quick-lint-js/issues/1194 +[#1199]: https://github.com/quick-lint/quick-lint-js/issues/1199 [E0001]: https://quick-lint-js.com/errors/E0001/ [E0003]: https://quick-lint-js.com/errors/E0003/