-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
builtins: make ltrimstr and rtrimstr error for non-string inputs
I also refactored the code in rtrimstr to make it more similar to the code used by ltrimstr. Previously, ltrimstr/rtrimstr would just the input pass through for non-string inputs or arguments. That was happening because, they were leaking the errors returned by startswith/endswith treating them as if they were jv_false(). This patch also fixes that memory leak discovered by oss-fuzz Ref: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64946
- Loading branch information
Showing
2 changed files
with
35 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters