Summary:ASTERISK-19651: Coverity Report: Fix issues for error type SIZEOF_MISMATCH
Reporter:Matt Jordan (mjordan)Labels:
Date Opened:2012-04-06 14:15:27Date Closed:
Versions: 13.18.4 Frequency of
Environment:Attachments:( 0) core_SIZEOF_MISMATCH.txt
( 1) extended_SIZEOF_MISMATCH.txt
Description:Resolve findings from Coverity Static Analysis Report for type SIZEOF_MISMATCH.

Note that the findings are contained in the files attached to this issue, organized by module support level.
Comments:By: Matt Jordan (mjordan) 2012-04-06 15:47:12.353-0500

sched.c: 472 - fixed by RB
md5.c:160 - fixed by RB
features.c:2762,2792,2825 - fixed by RB
app_externalivr.c:517 - fixed by RB
res_adsi.c:589 - fixed by RB
chan_iax2.c:4342,4454 - fixed by RB
logger.c, 485-490 - fixed by RB

By: Matt Jordan (mjordan) 2012-04-06 15:48:15.477-0500

Ones left:

By: Matt Jordan (mjordan) 2012-04-10 12:42:14.243-0500

Updated with issues removed that were fixed by Russell.

By: Matt Jordan (mjordan) 2012-04-13 16:36:06.891-0500

Finding #0, 1, 4 - not fixing, in Berkley DB and not worth the risk
Finding #2 - not a bug.  chan_sip uses sip_setoption to handle AST_OPTION_MAKE_COMPATIBLE, and it expects data to be a pointer to an ast_channel, and it passes that off to another handler.  At no point in time do we use datalen to determine if what the void * actually points to is of size ast_channel (as opposed to size of the pointer)
Finding #3 - this is tricky, but shouldn't be a problem.  The samples are stored in an u_int8 buffer, while the amplitudes are stored in an int16 buffer.  To get the position in the amplitudes that the sample pointer corresponds to, it needs to be shifted appropriately.
Finding #5 - Fixed
Finding #6 - Already fixed