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

Peter Hatina phatina at redhat.com
Tue Apr 3 06:56:12 PDT 2012


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: " << m_port);
>> +    if (sport < 0)
>> +        LOG_ERROR("invalid secure port: " << m_secure_port);
>> +    if (port < 0 && sport < 0)
>> +        return;
> 
> Do we really want to proceed if any of the value is incorrect? I would say no.

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.

Can anyone competent tell me, if to stop or not?

-- 
Peter Hatina
EMEA ENG-Desktop Development
Red Hat Czech, Brno


More information about the Spice-devel mailing list