Hi Eitan,

On 21:25 Tue 03 Oct     , Eitan Zahavi wrote:
> Hi Hal,
> 
> This is another case where Michael complains about the patch not 
> providing range checking.
> However, range checking is not implemented for the rest of this parser 
> code.

There are only two occurrences of strtoul() in this parser and both are
touched by the patch.

BTW what is the goal of int/int casting in this and other WinIB patches?
VC warnings preventing?

It does not help to make the code more readable and potentially could
hide a problems.

Sasha

> So I think
> the range check should be a separate patch.
> 
> Please let me know if this works for you
> 
> Thanks
> 
> 
> Michael S. Tsirkin wrote:
> 
> >Quoting r. Eitan Zahavi <[EMAIL PROTECTED]>:
> >  
> >
> >>                            p++;
> >>-                   port_num = strtoul(p, &q, 10);
> >>+                   port_num = (uint8_t)strtoul(p, &q, 10);
> >>                    if (q && !isspace(*q)) {
> >>    
> >>
> >
> >Would it make sense to range-check the value before casting it away?
> >  
> >
> 
> 
> _______________________________________________
> openib-general mailing list
> [email protected]
> http://openib.org/mailman/listinfo/openib-general
> 
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
> 

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to