History

avfilter/af_headphone: Don't use uninitialized buffer in log message

This buffer was supposed to be initialized by sscanf(input, "%7[A-Z]%n", buf, &len), yet if the first input character is not in the A-Z range, buf is not touched (in particular it needn't be zero-terminated if the failure happened when parsing the first channel and it still contains the last channel name if the failure happened when one channel name could be successfully parsed). This is treated as error in which case buf is used directly in the log message. This commit fixes this by actually using the string that could not be matched in the log message instead.

Andreas Rheinhardt committed 6 years ago

Commit e2d4a581 parent 3c7cad61 file · +1 −1Browse files

Unified · Split

libavfilter/af_headphone.c+1−1
@@ -135,7 +135,7 @@ static void parse_map(AVFilterContext *ctx) · 134 unmodified lines
135135
136136 p = NULL;
137137 if (parse_channel_name(s, s->nb_irs, &arg, &out_ch_id, buf)) {
138− av_log(ctx, AV_LOG_WARNING, "Failed to parse \'%s\' as channel name.\n", buf);
138+ av_log(ctx, AV_LOG_WARNING, "Failed to parse \'%s\' as channel name.\n", arg);
139139 continue;
140140 }
141141 s->mapping[s->nb_irs] = out_ch_id;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t