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

Fixed edge case where ecid may start with 0x #511

Merged
merged 3 commits into from
Dec 12, 2022

Conversation

MrManiacc
Copy link
Contributor

When using a program such as checkra1n the ecid may start with 0x.

This causes the exception seen below. I wrote this quick patch, it is untested but the general idea should be there. My actual ecid is the only piece of information I spoofed in the exception below.

java.lang.NumberFormatException: For input string: "0x123431234501E" under radix 16
	at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
	at java.base/java.lang.Long.parseLong(Unknown Source)
	at airsquared.blobsaver@3.3.0/airsquared.blobsaver.app.TSS.saveBlobsTSSSaver(Unknown Source)
	at airsquared.blobsaver@3.3.0/airsquared.blobsaver.app.TSS.call(Unknown Source)
	at airsquared.blobsaver@3.3.0/airsquared.blobsaver.app.TSS.call(Unknown Source)
	at javafx.graphics@19/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

MrManiacc and others added 2 commits November 30, 2022 01:34
java.lang.NumberFormatException: For input string: "0x162431234501E" under radix 16
	at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
	at java.base/java.lang.Long.parseLong(Unknown Source)
	at airsquared.blobsaver@3.3.0/airsquared.blobsaver.app.TSS.saveBlobsTSSSaver(Unknown Source)
	at airsquared.blobsaver@3.3.0/airsquared.blobsaver.app.TSS.call(Unknown Source)
	at airsquared.blobsaver@3.3.0/airsquared.blobsaver.app.TSS.call(Unknown Source)
	at javafx.graphics@19/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Fixed edge case where ecid may start with 0x
@airsquared
Copy link
Owner

airsquared commented Dec 12, 2022

Could this cause issues when a user has an ECID that is only digits, even in hex representation? (see #272)

@airsquared
Copy link
Owner

I just realized, it doesn't matter because the radix is specified as 16 when calling Long.parseLong(...). 🤦‍♂️

@airsquared airsquared merged commit 9099daa into airsquared:master Dec 12, 2022
airsquared added a commit that referenced this pull request Dec 12, 2022
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

Successfully merging this pull request may close these issues.

2 participants