mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Make sure we dont write more bytes into filename than the array is long.
just a precaution in case the size of the source array is increased or made dynamically allocateable. Originally committed as revision 21926 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
6a2459059e
commit
bbdf0d2214
@ -1580,7 +1580,7 @@ static int mov_open_dref(ByteIOContext **pb, char *src, MOVDref *ref)
|
||||
}
|
||||
|
||||
/* compose filename if next level down to target was found */
|
||||
if (i == ref->nlvl_to - 1) {
|
||||
if (i == ref->nlvl_to - 1 && src_path - src < sizeof(filename)) {
|
||||
memcpy(filename, src, src_path - src);
|
||||
filename[src_path - src] = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user