Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lax argument validation cause crash with some at-rules #47

Open
rubycon opened this issue Jun 30, 2021 · 0 comments
Open

Lax argument validation cause crash with some at-rules #47

rubycon opened this issue Jun 30, 2021 · 0 comments

Comments

@rubycon
Copy link

rubycon commented Jun 30, 2021

When processing at-rules, postcss-functions expect the node to have a "params" entry but not all at-rules have params. So node.params can be undefined and cause an error when passed to postcss-value-parser.

export function transformAtRule(node, functions) {
return then(transformString(node.params, functions), value => {
node.params = value;
});
}

The transformString() function should check if a proper string is supplied and fallback to an empty string or avoid parsing if not.

I never had any troubles with PostCSS and font-face rules before. I only notice this bug after a recent update. Apparently my occurrence of the bug is triggered by postcss-font-magician which inject its own at-rules with no params entry (which is not a bug).

@rubycon rubycon changed the title Lack robustness with some at-rules Lax argument validation cause crash with some at-rules Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant