]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr_rec: Fix a buffer overflow in filename generation
authorRuben De Smet <ruben.de.smet@rubdos.be>
Mon, 5 Jun 2023 13:18:46 +0000 (15:18 +0200)
committerFlole998 <Flole998@users.noreply.github.com>
Mon, 5 Jun 2023 15:39:14 +0000 (17:39 +0200)
Fixes https://tvheadend.org/issues/6272

Co-authored-by: Dave Pickles
src/dvr/dvr_rec.c

index d8b95a1ba18ebe76133d4e8e79b4810cc3a96893..eec60585d3d7c923f2a4ad37416ae1a7191bd1ae 100644 (file)
@@ -1088,7 +1088,7 @@ pvr_generate_filename(dvr_entry_t *de, const streaming_start_t *ss)
       j--;
     s[j] = '\0';
     snprintf(path + l, sizeof(path) - l, "%s", s);
-    snprintf(path + l + j, sizeof(path) - l + j, "/%s", filename);
+    snprintf(path + l + j, sizeof(path) - (l + j), "/%s", filename);
   }
 
   /* Substitute time formatters */