[asterisk-dev] [Code Review] Properly detect overflow on int32 and uint32 types in ast_parse_arg

Matt Jordan reviewboard at asterisk.org
Thu Aug 16 17:16:47 CDT 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2073/#review6916
-----------------------------------------------------------

Ship it!


- Matt


On Aug. 16, 2012, 5:10 p.m., Terry Wilson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2073/
> -----------------------------------------------------------
> 
> (Updated Aug. 16, 2012, 5:10 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> strtol functions can return LONG_MIN/MAX legitimately and when there is an error. The proper way to check for error is to set errno = 0 and test errno after the conversion.
> 
> 
> This addresses bug ASTERISK-20120.
>     https://issues.asterisk.org/jira/browse/ASTERISK-20120
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/main/config.c 371391 
> 
> Diff: https://reviewboard.asterisk.org/r/2073/diff
> 
> 
> Testing
> -------
> 
> Test failed on 32-bit, now passes. Also passes on 64-bit.
> 
> 
> Thanks,
> 
> Terry
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120816/50051d13/attachment.htm>


More information about the asterisk-dev mailing list