History

fftools/ffprobe: Fix hypothetical stack buffer overflow

It can't really happen, because no currently used pixel format has a name exceeding the size of the buffer.

Andreas Rheinhardt committed 1 year ago

Commit 9d543271 parent 2a2b5ae1 file · +3 −3Browse files

Unified · Split

fftools/ffprobe.c+3−3
@@ -2666,10 +2666,10 @@ static void print_pixel_format(WriterContext *w, enum AVPixelFormat pix_fmt) · 2665 unmodified lines
26662666 char buf[128];
26672667 size_t i = 0;
26682668
2669− while (s[i] && s[i] == s2[i])
2669+ while (s[i] && s[i] == s2[i] && i < sizeof(buf) - 1) {
2670+ buf[i] = s[i];
26702671 i++;
2671−
2672− memcpy(buf, s, FFMIN(sizeof(buf) - 1, i));
2672+ }
26732673 buf[i] = '\0';
26742674
26752675 print_str ("pix_fmt", buf);

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