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

ServiceNow link crashes finicky.log() #328

Open
nemws1 opened this issue May 13, 2024 · 3 comments · May be fixed by #329
Open

ServiceNow link crashes finicky.log() #328

nemws1 opened this issue May 13, 2024 · 3 comments · May be fixed by #329
Labels

Comments

@nemws1
Copy link

nemws1 commented May 13, 2024

Describe the bug
Finicky dies/crashes/immediately exits with a ServiceNow link with logging turned on

Your configuration

// Use https://finicky-kickstart.now.sh to generate basic configuration
// Learn more about configuration options:
// https://github.com/johnste/finicky/wiki/Configuration
// https://github.com/johnste/finicky/wiki/Troubleshooting-&-Tips

module.exports = {
    defaultBrowser: "Firefox",

    rewrite: [
	    {
		    match(all) {
			    finicky.log(JSON.stringify(all, null, 2));
			    return false;
		    },
		    url: ({ url }) => url,
	    }
    ]
}

To Reproduce
Steps to reproduce the behavior:
I received this link (in Teams, but Finicky crashes no matter how I try to open it):

https://borderstates.service-now.com/nav_to.do?uri=%2Fincident.do%3Fsys_id%3Dec58338d470e4650d3b39d75536d4314%26sysparm_record_target%3Dtask%26sysparm_record_row%3D7%26sysparm_record_rows%3D11%26sysparm_record_list%3Dassigned_to%3D821397091bab09103baa64e8bc4bcbbf%5EstateNOT%2BIN3,4,7,6%5Esys_class_name%3Dincident%5EORDERBYpriority%5EORDERBYnumber

Clicking on it in Teams or copying the URL and trying to "open" it from the terminal crashes Finicky.

If I comment out the "finicky.log" line in my .finicky.js file, then it works fine.

Here's one of the crash files I got:
Finicky-2024-05-13-094003.ips.txt

@nemws1 nemws1 added the bug label May 13, 2024
sergei-dyshel added a commit to sergei-dyshel/finicky that referenced this issue May 15, 2024
Calling `NSLog(message!)` will interpret message as format string (see
[docs](https://developer.apple.com/documentation/foundation/1395275-nslog),
causing errors and even segfault in some edge cases. Instead, use proper
format string  and message as argument.

Fixes johnste#328.
@sergei-dyshel sergei-dyshel linked a pull request May 15, 2024 that will close this issue
@sergei-dyshel
Copy link

sergei-dyshel commented May 15, 2024

Happened for me too with other similar long URL. After some debugging and reading, it seems that % followed by some characters in URL is interpreted as format specifier by NSLog and crashes it. Proposed a fix in #329.

@sergei-dyshel
Copy link

Until pull request is merged, if you don't want to build by yourself, you can use
Finicky.zip
that I've built locally that includes that patch.

@nemws1
Copy link
Author

nemws1 commented May 15, 2024

Thanks for the build - works perfectly now! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants