Trailing slash causes SDL to exit #9

Closed
opened 3 years ago by duke · 7 comments
duke commented 3 years ago
Owner

reported by user on TG and @onryo

reported by user on TG and @onryo
Poster
Owner

we need some code like this to clean up the URL and prevent other stupid code from crashing:

if(url.endsWith("/") {
   url.chop(1); // chop last char off
}

The above code isn't perfect but will likely catch 99% of "slashitis" cases

we need some code like this to clean up the URL and prevent other stupid code from crashing: ``` if(url.endsWith("/") { url.chop(1); // chop last char off } ``` The above code isn't perfect but will likely catch 99% of "slashitis" cases
Poster
Owner

@onryo @jahway603 any interest to work on this bug before the 1.4.1 comes out?

@onryo @jahway603 any interest to work on this bug before the 1.4.1 comes out?
Collaborator

Do we know if this was resolved with SDL 1.5.0 release?

I can't tag @onryo to ask him if he is still having this issue... strange

Do we know if this was resolved with SDL 1.5.0 release? I can't tag @onryo to ask him if he is still having this issue... strange
Poster
Owner

@jahway603 this bug still exists. To verify, I simply did Edit>Settings in my working + running SDL 1.5.0, and I added a single slash the current lite server it had randomly selected.

SDL instantly coredumped with these useful details:

getSettings
doRPCWithDefaultErrorHandling :  "save"
doRPC :  "save"
litelib_process_response :  {
  "result": "success"
}
"Dark" theme  "Dark"  has loaded
Animation dark loaded
Set animation
getSettings
doAutoConnect  server= "https://lite.hush.community/"
Wallet exists: true
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/user/.cargo/git/checkouts/silentdragonlite-cli-13034352649a6f08/8535a11/lib/src/lightclient.rs:89:64
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
Aborted (core dumped)

I would say this bug has become less important to fix, since 1.5.0 autoselects from community servers, but it's still possible for somebody to put a slash by hand and get this shitty behavior.

The doAutoConnect() function needs to delete trailing slashes from sever URLs.

@jahway603 this bug still exists. To verify, I simply did Edit>Settings in my working + running SDL 1.5.0, and I added a single slash the current lite server it had randomly selected. SDL instantly coredumped with these useful details: ``` getSettings doRPCWithDefaultErrorHandling : "save" doRPC : "save" litelib_process_response : { "result": "success" } "Dark" theme "Dark" has loaded Animation dark loaded Set animation getSettings doAutoConnect server= "https://lite.hush.community/" Wallet exists: true thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/user/.cargo/git/checkouts/silentdragonlite-cli-13034352649a6f08/8535a11/lib/src/lightclient.rs:89:64 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace fatal runtime error: failed to initiate panic, error 5 Aborted (core dumped) ``` I would say this bug has become less important to fix, since 1.5.0 autoselects from community servers, but it's still possible for somebody to put a slash by hand and get this shitty behavior. The `doAutoConnect()` function needs to delete trailing slashes from sever URLs.
Poster
Owner

@jahway603 I just fixed this on the dev branch, give it a try if you want

@jahway603 I just fixed this on the `dev` branch, give it a try if you want
Collaborator

@jahway603 I just fixed this on the dev branch, give it a try if you want

Nice! This fixes it.

> @jahway603 I just fixed this on the `dev` branch, give it a try if you want Nice! This fixes it.
Poster
Owner

This fix will be included in next SDL release, so I guess we can close this

This fix will be included in next SDL release, so I guess we can close this
duke closed this issue 3 years ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.