From d0d9ace421ea86c0642c57865c41248df1fe0b00 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 8 Mar 2020 18:43:31 +0100 Subject: [PATCH] stream_file: mark fd protocols as "unsafe" Whatever good or bad that might do. In any case, they can easily trigger UB-like behavior. --- stream/stream.c | 2 ++ stream/stream_file.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/stream/stream.c b/stream/stream.c index c8b3d34a51..f5f61e93c9 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -51,6 +51,7 @@ extern const stream_info_t stream_info_ffmpeg; extern const stream_info_t stream_info_ffmpeg_unsafe; extern const stream_info_t stream_info_avdevice; extern const stream_info_t stream_info_file; +extern const stream_info_t stream_info_fd; extern const stream_info_t stream_info_ifo_dvdnav; extern const stream_info_t stream_info_dvdnav; extern const stream_info_t stream_info_bdmv_dir; @@ -87,6 +88,7 @@ static const stream_info_t *const stream_list[] = { &stream_info_mf, &stream_info_edl, &stream_info_file, + &stream_info_fd, &stream_info_cb, NULL }; diff --git a/stream/stream_file.c b/stream/stream_file.c index ec801cd82f..1c5223073b 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -351,8 +351,15 @@ static int open_f(stream_t *stream) const stream_info_t stream_info_file = { .name = "file", .open = open_f, - .protocols = (const char*const[]){ "file", "", "fd", "fdclose", - "appending", NULL }, + .protocols = (const char*const[]){ "file", "", "appending", NULL }, .can_write = true, .stream_origin = STREAM_ORIGIN_FS, }; + +const stream_info_t stream_info_fd = { + .name = "fd", + .open = open_f, + .protocols = (const char*const[]){ "fd", "fdclose", NULL }, + .can_write = true, + .stream_origin = STREAM_ORIGIN_UNSAFE, +};