ges-ui: Ensure that string is \0-terminated
authorSebastian Dröge <sebastian@centricular.com>
Tue, 28 Feb 2017 11:02:44 +0000 (13:02 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 28 Feb 2017 11:02:44 +0000 (13:02 +0200)
CID 1320699

examples/c/ges-ui.c

index 85005d7..4acd1ee 100644 (file)
@@ -523,7 +523,8 @@ str_to_time (const gchar * str)
 
   m = strtoull (buf, NULL, 10);
 
-  strncpy (buf, &str[6], sizeof (buf));
+  strncpy (buf, &str[6], sizeof (buf) - 1);
+  buf[sizeof (buf) - 1] = '\0';
   s = strtod (buf, NULL);
 
   ret = (h * 3600 * GST_SECOND) +