process_pipeline: replace sprintf with snprintf

to avoid potential buffer overflows
This commit is contained in:
Andrey Skvortsov
2025-05-28 01:06:52 +03:00
committed by Martijn Braam
parent f64782d9a5
commit 529e7841ab
3 changed files with 48 additions and 40 deletions

View File

@@ -1413,9 +1413,10 @@ activate(GtkApplication *app, gpointer data)
// Initialize the postprocessing gsetting to the old processor if
// it was not set yet
if (setting_postproc == NULL || setting_postproc[0] == '\0') {
const int size = 512;
printf("Initializing postprocessor gsetting\n");
setting_postproc = malloc(512);
if (!mp_process_find_processor(setting_postproc, "postprocess.sh")) {
setting_postproc = malloc(size);
if (!mp_process_find_processor(setting_postproc, size, "postprocess.sh")) {
printf("No processor found\n");
exit(1);
}