Re: [Spice-devel] [PATCH spice-xpi] Validate port values

2012-04-04 Thread Marc-André Lureau
On Wed, Apr 4, 2012 at 8:42 AM, Peter Hatina wrote: > The function int portToInt(const std::string &port) returns the values > from [-1 to 65535], so you would never error out. -1 was meant to be as > indicator of invalid transport layer port. If both ports are invalid, I > do not want to launch a

Re: [Spice-devel] [PATCH spice-xpi] Validate port values

2012-04-03 Thread Peter Hatina
Hi, On 04/03/2012 04:40 PM, Marc-André Lureau wrote: > > > - Mensaje original - >> On Tue, Apr 03, 2012 at 03:56:12PM +0200, Peter Hatina wrote: >>> On 04/03/2012 03:39 PM, Marc-André Lureau wrote: - Mensaje original - > > void nsPluginInstance::Connect(

Re: [Spice-devel] [PATCH spice-xpi] Validate port values

2012-04-03 Thread Marc-André Lureau
- Mensaje original - > On Tue, Apr 03, 2012 at 03:56:12PM +0200, Peter Hatina wrote: > > On 04/03/2012 03:39 PM, Marc-André Lureau wrote: > > > > > > > > > - Mensaje original - > > >> > > >> void nsPluginInstance::Connect() > > >> { > > >> +const int port = portToInt(m_p

Re: [Spice-devel] [PATCH spice-xpi] Validate port values

2012-04-03 Thread Alon Levy
On Tue, Apr 03, 2012 at 03:56:12PM +0200, Peter Hatina wrote: > On 04/03/2012 03:39 PM, Marc-André Lureau wrote: > > > > > > - Mensaje original - > >> > >> void nsPluginInstance::Connect() > >> { > >> +const int port = portToInt(m_port); > >> +const int sport = portToInt(m_sec

Re: [Spice-devel] [PATCH spice-xpi] Validate port values

2012-04-03 Thread Marc-André Lureau
- Mensaje original - > You mean, when there is one of the values valid and the other > invalid? > That's what I was asking on #spice. I do not know, if > spicec/virt-viewer > can work only with secure port. With unencrypted port, it works. It could work, in some cases, but I thought the

Re: [Spice-devel] [PATCH spice-xpi] Validate port values

2012-04-03 Thread Peter Hatina
On 04/03/2012 03:39 PM, Marc-André Lureau wrote: > > > - Mensaje original - >> >> void nsPluginInstance::Connect() >> { >> +const int port = portToInt(m_port); >> +const int sport = portToInt(m_secure_port); >> + >> +if (port < 0) >> +LOG_ERROR("invalid port: " <<

Re: [Spice-devel] [PATCH spice-xpi] Validate port values

2012-04-03 Thread Marc-André Lureau
- Mensaje original - > > void nsPluginInstance::Connect() > { > +const int port = portToInt(m_port); > +const int sport = portToInt(m_secure_port); > + > +if (port < 0) > +LOG_ERROR("invalid port: " << m_port); > +if (sport < 0) > +LOG_ERROR("invalid se

[Spice-devel] [PATCH spice-xpi] Validate port values

2012-04-03 Thread Peter Hatina
--- SpiceXPI/src/plugin/plugin.cpp | 32 ++-- 1 files changed, 30 insertions(+), 2 deletions(-) diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp index de7afd0..19f7716 100644 --- a/SpiceXPI/src/plugin/plugin.cpp +++ b/SpiceXPI/src/plugin/p