1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-06 14:02:47 -05:00

Apply `getservbyname' to the Port Number field in case it's

non-numeric. Patch due to Christian Biesinger.

[originally from svn r839]
This commit is contained in:
Simon Tatham
2001-01-07 15:12:20 +00:00
parent a24c502f4f
commit 5a908bb1d7
2 changed files with 20 additions and 2 deletions

View File

@ -314,6 +314,14 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
}
}
/* Check for invalid Port number (i.e. zero) */
if (cfg.port == 0) {
MessageBox(NULL, "Invalid Port Number",
"PuTTY Internal Error", MB_OK |MB_ICONEXCLAMATION);
WSACleanup();
return 1;
}
real_ldisc = (cfg.ldisc_term ? &ldisc_term : &ldisc_simple);
/* To start with, we use the simple line discipline, so we can
* type passwords etc without fear of them being echoed... */