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

bug(common/web): replaceExtension() in types/src/util/file-types.ts is vulnerable to null parameters and unused #12761

Closed
1 of 8 tasks
markcsinclair opened this issue Dec 3, 2024 · 0 comments · Fixed by #12762

Comments

@markcsinclair
Copy link
Contributor

markcsinclair commented Dec 3, 2024

Describe the bug

Function replaceExtension(filename: string, oldExtension: string, newExtension: string): string has a poor response to either the oldExtension or newExtension being null.

With a null oldExtension it throws TypeError: Cannot read properties of null (reading 'length').

With a null newExtension it returns the base filename with the four characters "null" appended.

However, it does not seem to be used anywhere.

Keyman apps

  • Keyman for Android
  • Keyman for iPhone and iPad
  • Keyman for Linux
  • Keyman for macOS
  • Keyman for Windows
  • Keyman Developer
  • KeymanWeb
  • Other - give details at bottom of form
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant