-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 07/11/2012 02:03 PM, Uri Lublin wrote: > On 07/11/2012 02:03 PM, Peter Hatina wrote: >> Hi, >> >> I had a request to validate TCP port values in spice-xpi, so does >> this make sense for you? >> >> More info at https://bugzilla.redhat.com/show_bug.cgi?id=805602 >> >> --- SpiceXPI/src/plugin/plugin.cpp | 27 >> +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 >> deletions(-) >> >> diff --git a/SpiceXPI/src/plugin/plugin.cpp >> b/SpiceXPI/src/plugin/plugin.cpp index b7f61ba..4aac37e 100644 >> --- a/SpiceXPI/src/plugin/plugin.cpp +++ >> b/SpiceXPI/src/plugin/plugin.cpp @@ -581,6 +593,15 @@ void >> nsPluginInstance::SendStr(uint32_t id, std::string str) >> >> void nsPluginInstance::Connect() { + const int port = >> portToInt(m_port); + const int sport = >> portToInt(m_secure_port); + if (port<= 0) + >> g_warning("invalid port: '%s'", m_port.c_str()); + if (sport<= >> 0) + g_warning("invalid secure port: '%s'", >> m_secure_port.c_str()); + if (port<= 0&& sport<= 0) + >> return; + > > I think simply returning here is not good. You should also send a > "disconnected" (or spice client exited) notification to the > caller. Fine, the only notification, we currently have and is not fully supported is calling JS OnDisconnected(). Or do you have something specific on your mind? > > Regards, Uri. - -- Peter Hatina EMEA ENG-Desktop Development Red Hat Czech, Brno -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJP/rV6AAoJELOyt3XzKCKp0MMH/3aXYLZIXxy3FZoGT2E6R3DF mDV4E/9R8KSntS1IlrvqktJ1UEAq2+xZx1TDOpfTUZqWTM++iDljqEGaO43WG46C 4Qq0+VO8AlPt8AShPLUsPBcCO+59nzyHLWyii3b8W7wIPZtqlNAEV/LO7EMjHYEg HKFFn7LK6ydsgdJoIPGt3XuymcEJLO2Wr/tyl/1fIcVz0clAx0Rmy4v5kUYozSnK EoKJM+rdg4zgQnvivRrL+mdMnJdZp6ZDprhsmp50OHuxShpzxq8i21eg3cCSWFih F0873z9kM3gvw9vLjYFMgRDQP7QJwkBl8sUGn66sPtSmbH+poiNKB8S3+tl0lrE= =jP2c -----END PGP SIGNATURE----- _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel