Files
Alexandre Fournier 6b703b12d5 format_cap: guard against NULL src in *_from_cap helpers
ast_format_cap_append_from_cap() and ast_format_cap_replace_from_cap()
dereference 'src' (src->preference_order) without checking it for NULL.

A dummy channel allocated with ast_dummy_channel_alloc() never sets a
native-format capability, so ast_channel_nativeformats() returns NULL on
such channels. When CHANNEL(audionativeformat) / CHANNEL(videonativeformat)
is evaluated against a dummy channel (e.g. via ARI channelvars during a
Stasis VarSet event raised while app_voicemail builds the notification
email on a dummy channel), func_channel_read() passes that NULL straight
into ast_format_cap_append_from_cap(), causing a NULL dereference at
offset 0x28 and a SIGSEGV.

Guard both helpers against a NULL source. A NULL source simply means
"no formats to copy", so appending/replacing nothing is the correct
no-op behaviour. This also protects all other callers.

Fixes https://github.com/asterisk/asterisk/issues/1992

AI disclosure: this was generated using Claude Opus 4.8, tested to fix the issue. Not sure if it is the *right* way to do it.
2026-06-25 23:39:39 +00:00
..
2025-02-20 21:46:27 +00:00
2025-02-20 21:46:27 +00:00
2025-02-20 21:46:27 +00:00
2025-02-20 21:46:27 +00:00
2023-12-08 13:11:48 +00:00
2025-02-20 21:46:27 +00:00
2023-12-08 13:11:48 +00:00
2025-02-20 21:46:27 +00:00
2021-12-02 15:02:09 -06:00
2021-12-02 15:02:09 -06:00
2021-12-02 15:02:09 -06:00
2021-12-02 15:02:09 -06:00
2021-12-02 15:02:09 -06:00
2025-01-16 15:32:48 +00:00
2025-08-06 15:37:46 +00:00
2026-03-02 16:43:24 +00:00
2021-12-02 15:02:09 -06:00
2022-07-07 08:19:14 -05:00
2025-02-20 21:46:27 +00:00
2020-06-10 09:33:28 -05:00
2021-12-02 15:02:09 -06:00
2025-02-20 21:46:27 +00:00
2024-08-12 15:21:31 +00:00
2021-11-15 17:33:27 -06:00
2021-12-02 15:02:09 -06:00
2025-04-02 12:16:35 +00:00
2025-01-29 14:17:54 +00:00
2025-01-29 14:17:54 +00:00
2025-01-29 14:17:54 +00:00
2025-01-29 14:17:54 +00:00
2025-04-21 13:29:27 +00:00
2021-12-02 15:02:09 -06:00
2025-02-20 21:46:27 +00:00
2021-12-02 15:02:09 -06:00
2025-01-29 14:17:54 +00:00
2021-12-02 15:02:09 -06:00
2021-12-02 15:02:09 -06:00
2025-02-20 21:46:27 +00:00
2025-01-29 14:17:54 +00:00
2025-01-29 14:17:54 +00:00
2021-12-02 15:02:09 -06:00
2021-11-15 17:33:27 -06:00
2021-12-02 15:02:09 -06:00
2021-11-18 14:46:42 -06:00
2025-01-29 14:17:54 +00:00
2025-01-29 14:17:54 +00:00
2025-06-02 16:35:27 +00:00
2025-02-20 21:46:27 +00:00
2021-12-02 15:02:09 -06:00
2022-03-24 12:00:58 -05:00
2025-02-20 21:46:27 +00:00
2021-12-02 15:02:09 -06:00