[Home]

Summary:ASTERISK-25533: [patch] buffer for ast_format_cap_get_names only 64 bytes
Reporter:Alexander Traud (traud)Labels:
Date Opened:2015-11-09 03:01:31.000-0600Date Closed:2015-11-10 15:00:43.000-0600
Priority:TrivialRegression?
Status:Closed/CompleteComponents:Formats/General
Versions:SVN 13.6.0 Frequency of
Occurrence
Related
Issues:
duplicatesASTERISK-24732 [patch]CLI "core show channel" gets "failed to extend from %d to %d" message for large native formats list.
Environment:Attachments:( 0) codec_buf_13.patch
( 1) codec_buf_master.patch
Description:Several places in code output the names of all formats/codecs to the end-user, for example on the CLI via {{sip show settings}} or {{pjsip show endpoint}}. I was trapped by this issue while debugging/monitoring a SIP/SDP negotiation. If that list of names (including the commas) is longer than 64 bytes, the list is incomplete and ends with a {{|}}. This can be overlooked easily. For a project of mine, I added several new formats for pass-through and transcoding. Furthermore while testing, I allowed all formats. In my case, the length was 262 characters. Even with the built-in codecs and all allowed, 64 bytes were not enough.

The attached patch tries to fix all occurrences. In main/manager.c, the buffer was increased in master already. Furthermore, different values are used already (64, 128, 256). The proposed patch changes all occurrences to a rather unique value of 384. This amount is not only sufficient for my case, but helps to find these buffers, when an even bigger buffer is required one day.
Comments: