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

Terry Wilson reviewboard at asterisk.org
Thu Aug 16 17:10:59 CDT 2012


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

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/71870d5c/attachment.htm>


More information about the asterisk-dev mailing list