Opened 4 years ago

Last modified 4 months ago

#14640 new bug

Application Crashes when Missing SSH Port (easy)

Reported by: krb2018 Owned by: mmlr
Priority: normal Milestone: R1
Component: Applications/RemoteDesktop Version: R1/beta1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Launching RemoteDesktop myuser@myhost -s from Terminal causes an error that prevents the application from continuing. Crash does not occur unless port isn't supplied for -s, so it might be a problem with input validation. I verified that it doesn't matter whether the host and username are valid, as it happens regardless.

Attachments (1)

RemoteDesktop-520-debug-17-10-2018-17-24-25.report (11.7 KB ) - added by krb2018 4 years ago.
Crash Report

Download all attachments as: .zip

Change History (3)

by krb2018, 4 years ago

Crash Report

comment:1 by leavengood, 4 months ago

It does look like the logic is wrong here:

https://git.haiku-os.org/haiku/tree/src/apps/remotedesktop/RemoteDesktop.cpp#n96

if (strcmp(argv[i], "-s") == 0) {
	if (argc >= i + 1
		&& sscanf(argv[i + 1], "%" B_SCNu16, &sshPort) == 1) {
		i++;
	}

It should be if (argc > i + 1, or it should mimic some of the other blocks which invert the logic and then show the usage if the logic fails.

If no one else makes this small fix I'll make it next time I am doing Haiku development.

comment:2 by pulkomandy, 4 months ago

Summary: Application Crashes when Missing SSH PortApplication Crashes when Missing SSH Port (easy)
Note: See TracTickets for help on using tickets.