Opened 6 years ago

Closed 20 months ago

#14640 closed bug (fixed)

Application Crashes when Missing SSH Port (easy)

Reported by: krb2018 Owned by: mmlr
Priority: normal Milestone: R1/beta4
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 6 years ago.
Crash Report

Download all attachments as: .zip

Change History (5)

by krb2018, 6 years ago

Crash Report

comment:1 by leavengood, 2 years 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, 2 years ago

Summary: Application Crashes when Missing SSH PortApplication Crashes when Missing SSH Port (easy)

comment:3 by dgillman, 20 months ago

Addressing in: https://review.haiku-os.org/c/haiku/+/5596

Seems like none of the parameter validation worked as coded. Updated logic for all parameter validation.

comment:4 by waddlesplash, 20 months ago

Milestone: R1R1/beta4
Resolution: fixed
Status: newclosed

Fix was merged in hrev56420

Note: See TracTickets for help on using tickets.