Fix potentially unterminated string (#1844).
authorCarl Hetherington <cth@carlh.net>
Wed, 23 Sep 2020 15:15:15 +0000 (17:15 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 23 Sep 2020 15:15:15 +0000 (17:15 +0200)
src/lib/transcode_job.cc

index c13f69d70f15d51789b1ca49a017ce3dae838bf4..3fbd91841473bafb06056604a29f79402588e27d 100644 (file)
@@ -125,7 +125,7 @@ TranscodeJob::status () const
 
        char buffer[256];
        if (finished() || _encoder->finishing()) {
-               strncpy (buffer, Job::status().c_str(), 256);
+               strncpy (buffer, Job::status().c_str(), sizeof(buffer) - 1);
        } else {
                snprintf (
                        buffer, sizeof(buffer), "%s; %" PRId64 "/%" PRId64 " frames",