Fix potential buffer overflow.
authorCarl Hetherington <cth@carlh.net>
Tue, 23 Aug 2016 08:28:17 +0000 (09:28 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 23 Aug 2016 08:28:17 +0000 (09:28 +0100)
src/tools/dcpomatic_kdm_cli.cc

index 5126e1954c10405b1929c2acf0a72e1b188afa11..65b98ee424dffea948573b578538a3c1518a4014 100644 (file)
@@ -83,7 +83,7 @@ duration_from_string (string d)
 {
        int N;
        char unit_buf[64] = "\0";
 {
        int N;
        char unit_buf[64] = "\0";
-       sscanf (d.c_str(), "%d %64s", &N, unit_buf);
+       sscanf (d.c_str(), "%d %63s", &N, unit_buf);
        string const unit (unit_buf);
 
        if (N == 0) {
        string const unit (unit_buf);
 
        if (N == 0) {