[FFmpeg-devel] [PATCH 1/2] ffserver: Fix off by 1 error in path

Michael Niedermayer michael at niedermayer.cc
Sun Oct 22 18:11:20 EEST 2017


Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 fftools/ffserver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fftools/ffserver.c b/fftools/ffserver.c
index d4885dfa0e..51f31bc704 100644
--- a/fftools/ffserver.c
+++ b/fftools/ffserver.c
@@ -499,9 +499,9 @@ static void start_children(FFServerStream *feed)
     if (!slash) {
         pathname = av_mallocz(sizeof("ffmpeg"));
     } else {
-        pathname = av_mallocz(slash - my_program_name + sizeof("ffmpeg"));
+        pathname = av_mallocz(slash - my_program_name + 1 + sizeof("ffmpeg"));
         if (pathname != NULL) {
-            memcpy(pathname, my_program_name, slash - my_program_name);
+            memcpy(pathname, my_program_name, slash - my_program_name + 1);
         }
     }
     if (!pathname) {
-- 
2.14.2



More information about the ffmpeg-devel mailing list